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

2013/3/23

Power up to fire two bullets at once

TheRecallGamer TheRecallGamer

2013/3/23

#
So i'm working on a invaders project for school and i'm trying to add a power up that make the player shoot two bullets at once instead of the default single bullet. Any help would be greatly appreciated! Thanks!
danpost danpost

2013/3/23

#
Just add a boolean field to the player class; call it 'doubleShooting'. When the power-up is collected, change its value to true. In the method for shooting, add the code to shoot two bullets instead of one if the value of the field is true, and shoot only one bullet if the value of the field is false.
You need to login to post a reply.