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

2013/4/10

Shooting Problems

cecarson cecarson

2013/4/10

#
I need help with shooting. You see, there are courses at Montclaire University for gifted and talented children, including me, not bragging, and one of my classes are called Java Programming where we use Greenfoot to learn basic Java coding. As a final project, we have to make a game using most of the stuff we have learned. Shooting was not one of them but it was part of the scenario for one of the tutorials. My partner and I are making a two-player paintball game. Now I used the coding from the tutorial but I can only shoot up. I want it to shoot in the way I am facing. I looked at a video that taught me how to shoot in the way I am facing, but if I use it, I will have to change almost all the coding in every class. Please tell me how I can shoot the way I am facing even when I rotate.
davmac davmac

2013/4/10

#
1. Set the bullet rotation to the same as the rotation of whatever is shooting it. 2. The Bullet should use the move() method (with an int parameter) to move. Done.
cecarson cecarson

2013/4/11

#
I know but that would cause me to change the entire coding.
davmac davmac

2013/4/12

#
You just have to alter the coding for where the bullet is created, and where it moves.
You need to login to post a reply.