PDA

Click to See Complete Forum and Search --> : Moving picture + shooting with keys


May 13th, 1999, 11:00 AM
I am making a 'space invaders' sort of game. Can someone please tell me how the heck I can fire AND move at the same time. At the moment, every time the user presses the fire button, the bullet does what it should, but the 'ship' stops moving.
Sample code would be extremely usefull :-)

SteveCRM
Aug 26th, 1999, 11:26 AM
Use The Keydown even

If KeyCode = vbKeyLeft Then Image1.Left = Image1.Left - 200
If KeyCode = vbKeyRight Then Image1.Left = Image1.Left + 200
If KeyCode = vbKeyUp Then Image1.Top = Image1.Top - 200
If KeyCode = vbKeyDown Then Image1.Top = Image1.Top + 200

This moves image1 up down left and right
Hope it helps!
Steve