I am making a game somewhat similar to Scorched Earth in Flash MX 2004. What I need help with is making a gun who’s rotation is controlled by arrow keys.
This is as far as I have gotten so far but I will definately need further help once this step is completed.
I just need script to make the gun rotate at 10 degree intervals and keep track of its position with a variable.
After this I will make different weapons to be fired out of the gun.
Just have an mc that’s a turret and put this code in.
onClipEvent(enterFrame){
//keep track of position
position=this._rotation;
//to rotate the turret…
if (Key.isDown(Key.RIGHT)){
this._rotation+=10;
}
if (Key.isDown(Key.LEFT)){
this._rotation-=10;
}
}
remember to put the movie clip origin on one side of the turret so it rotates correctly.