Saturday, February 16, 2019

Power Ups!


Originally I had the power up generator code initiate every time the timer hit a certain number.  This worked great but collision detection never worked.  After wracking my brain I recall that sometimes when the score goes below a certain number the cars added for difficulty stop moving and collision detection ceased to work in those instances as well.

So instead of tying power up generation to the timer I tied it to the score, with it initiating at greater than or equal to zero.  Then in the bank where the code was, I created another variable to mirror the timer variable.  Now the power ups generate as they should but with one small problem - I am having a problem getting rid of them promptly.

For instance, the energy drink appears. If the player sits over the drink at the time it eventually disappears they get the benefit (for testing purposes this is just 500 points).  I assume this has something to do with the timing.  I will investigate this further at a later time
 

No comments:

Post a Comment

Manatee Madness!

Stage work is coming along nicely, with the foundations laid down for the Rain, Snow, and Volcano stage. The Black Friday stage is proving ...