12-16-2003, 10:55 AM
Hi i was just wondering how i could achieve a moving line across the screen such that i can implement it on space key pressed, i have the following idea.
1 - create a circle or line to represent the bullet.
2 - rotate, translate and scale it to required properties.
3 = Attach it to variable stored in ships movement in case statement keyEvent so when the space bar is pressed the object will appear next to (infront of the ship.
4 - pushmatrix save current state, and increment line or circles x coordinte by small amount popmatrix.
5 keep incrementing so the line or circle that represents my bullet carry's on over to the far side of the screen.
ok, is this the right way to do this, and how do i create the effect so the movement of the bullet keeps incrementing while i can still move my ship object around.
I thank all of you and appreciate any help, steve.
1 - create a circle or line to represent the bullet.
2 - rotate, translate and scale it to required properties.
3 = Attach it to variable stored in ships movement in case statement keyEvent so when the space bar is pressed the object will appear next to (infront of the ship.
4 - pushmatrix save current state, and increment line or circles x coordinte by small amount popmatrix.
5 keep incrementing so the line or circle that represents my bullet carry's on over to the far side of the screen.
ok, is this the right way to do this, and how do i create the effect so the movement of the bullet keeps incrementing while i can still move my ship object around.
I thank all of you and appreciate any help, steve.