I have almost solved the lingering power-up problem. Previously the power-up would spawn and when Bag Boy would collide with it it would stay. I had finally realized that with each loop I had a variable continually adding up. So at a particular value the variable would go to the generation subroutine but that variable would continue adding which seemed to negate the collision. To solve this I placed an if then line before the variable value that checked to see if it was the generation value. If yes it skipped the generation code and go to the collision detection. Then, once collision is detected it resets the value.
Once the bugs are worked out I will give each power up a specific ability and hammer out the randomization code to make it balanced.
Once the bugs are worked out I will give each power up a specific ability and hammer out the randomization code to make it balanced.
No comments:
Post a Comment