I need help
I need help
In my game the missile when enter is pressed moves from where the fighter is, to the top of the screen in one frame and I can't get it to go any slower and the missile won't fire from a new position when the fighter is moved left or right . Also the red enemy moves extremely fast from the top of the screen to the bottom.
- Attachments
-
- MyGame.zip
- (667.34 KiB) Downloaded 146 times
CraigSpaz
Re: I need help
Code: Select all
if( kbd.EnterIsPressed() )
{
for(DrawFighterMissile( FighterMissileX, FighterMissileY ); FighterMissileY > 5; FighterMissileY-- );
}
What I suggest is, that you make a boolean for the missile to see if it has been launched. then, separate from "enter is pressed" you check if the missile launched is true and make the Y position move up once eg.:
Code: Select all
if( kbd.EnterIsPressed() )
{
if (BoolMissile == false) {BoolMissile = true;}
}
if (BoolMissile == true) {if (FighterMissileY > 5) {FighterMissileY -= 5;} else {BoolMissile = false; FighterMissileY = 550;}}
ʕ •ᴥ•ʔ