Results 1 to 2 of 2

Thread: Moving picture + shooting with keys

  1. #1
    Guest

    Post

    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 :-)

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width