This site requires JavaScript, please enable it in your browser!
Greenfoot back
DOGGY
DOGGY wrote ...

2012/10/25

Adding bonus in game

DOGGY DOGGY

2012/10/25

#
Hello, Im making a sort of pong game only now i have a problem. I want the game to randomly add bonus items in the field. Bonus items which automatically appears in the game and also randomly. If none of the players are able to grab the bonus, i want the bonus item to dissapear automatically after 6 seconds. I have a ball class, bonus class and 2 player classes Any help?
danpost danpost

2012/10/25

#
Let the act() method in the world class control the adding of the bonus objects and the act() method in the bonus class control the timed-removal. You could have the bonus class constructor randomly choose the bonus type and randomly choose the specifics involved with the type chosen.
DOGGY DOGGY

2012/10/30

#
that could be an option. can you help me with the code? because i really have no idea where to start Thank you
You need to login to post a reply.