DEV LOG #4 - 02/25/25
Building upon my class and vector work from last week is this week's project. Instead of having a horde of Penguins moving in a semi-fixed-but-not-really pattern, I wanted to have a unique layout of Penguins being spawned every second. I was originally going to do minute, but quite frankly I was too impatient during testing and sped it up.
The code took me a while to figure out, but it's ultimately pretty simple. I re-use the original penguin class from my work last week, but instead of having a penguin pattern created once at startup, I moved it into draw so it could actually change.
Small problem: now it runs every frame and these penguins are going crazy! So, what I had to do was create a variable, minVar, to keep track of the amount of time that had passed before allowing a new penguin group to be generated.
It was a bit confusing to figure out, as originally I was just checking if minVar no longer equalled itself, as I defined minVar within the draw function. This shortsighted mistake was soon noticed and rectified, and then the whole thing came together very nicely.
What I learned this week is that, even though I am slowly regaining my ability to code, I need to sometimes slow down and really think about how the things I'm writing really work so that I don't make silly mistakes.
My code can be found here.
This week's Development Song is Brown Paper Bag by DJ Khaled
https://youtu.be/ndqHvkWPEWM?si=Av7h32oAreXssHV0
Small problem: now it runs every frame and these penguins are going crazy! So, what I had to do was create a variable, minVar, to keep track of the amount of time that had passed before allowing a new penguin group to be generated.
It was a bit confusing to figure out, as originally I was just checking if minVar no longer equalled itself, as I defined minVar within the draw function. This shortsighted mistake was soon noticed and rectified, and then the whole thing came together very nicely.
What I learned this week is that, even though I am slowly regaining my ability to code, I need to sometimes slow down and really think about how the things I'm writing really work so that I don't make silly mistakes.
My code can be found here.
This week's Development Song is Brown Paper Bag by DJ Khaled
https://youtu.be/ndqHvkWPEWM?si=Av7h32oAreXssHV0
Comments
Post a Comment