How can I make a rocket, that moves all around the screen and turns 360 degrees in both directions, fire bullets in the direction it's facing and not just up, down, left and right. Any help is greatly appreciated.
Offline
x key turns it left by 15 degrees each press, the c key turns it right 15 degrees each press, the space gives it a boost which ever direction it is going in and z key fires the bullet. I can make the bullets go up, down, left and right but I want more than that. I'm just puzzled how to get the bullet to fire in the direction the rocket is travelling at the time.
Offline
Here is the script for the rocket:
And the bullet script:whenclicked
foreverifkeyx ▼pressed?turn
15degreesifkeyc ▼pressed?turn
15degreesifkeyspace ▼pressed?move7steps
Hope that helped!whenclicked
foreverpoint in directiondirection ▼ofrocket ▼ifkeyz ▼pressed?repeat untiltouchingorenemy ▼?touchingedge ▼?move5stepsgo torocket ▼
Offline
7734f wrote:
Here is the script for the rocket:
And the bullet script:whenclicked
foreverifkeyx ▼pressed?turn
15degreesifkeyc ▼pressed?turn
15degreesifkeyspace ▼pressed?move7stepsWouldn't that just make it move 7 steps and then be done?Hope that helped!whenclicked
foreverpoint in directiondirection ▼ofrocket ▼ifkeyz ▼pressed?repeat untiltouchingorenemy ▼?touchingedge ▼?move5stepsgo torocket ▼
~7734f
Offline
Maltese_Falcon wrote:
7734f wrote:
Here is the script for the rocket:
And the bullet script:whenclicked
foreverifkeyx ▼pressed?turn
15degreesifkeyc ▼pressed?turn
15degreesifkeyspace ▼pressed?move7stepsWouldn't that just make it move 7 steps and then be done?Hope that helped!whenclicked
foreverpoint in directiondirection ▼ofrocket ▼ifkeyz ▼pressed?repeat untiltouchingorenemy ▼?touchingedge ▼?move5stepsgo torocket ▼
~7734f
If you hold down space then it moves. I think that's what he meant.
Offline
Thanks for the scripts. They wasn't exactly what I wanted but with a few tweeks and bit of luck I finally got what I wanted. Thanks 7734f
Offline