Results 1 to 6 of 6

Thread: NEWBIE: making an object move on a form using arrow keys.

  1. #1

    Thread Starter
    Hyperactive Member dflw's Avatar
    Join Date
    Apr 2001
    Location
    ct, usa
    Posts
    412

    NEWBIE: making an object move on a form using arrow keys.

    hello,

    i am a newbie in vb6 game programming.(when i say newbie, i mean i'm starting from scratch . anyway, i want to know how i can make an object like an image move about on a form using the arrow keys.
    thanks for any help. (this is the very first step into my game programming career...)
    Visual Basic 6, HTML, JavaScript, learning C++

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Set the form's KeyPreview property to True, and then in the form's KeyDown Event, you can check which key has been pressed and change the image's Top and Left properties to make it move around. You can check which key has been pressed by seeing what the value of KeyCode in the Form_KeyDown() event is. Check the help files for information about the key codes.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Review this step of my tutorial

    oh and Harry: if it's an ImageBox you don't neet KeyPreview ^_^

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Right

    Just read Fox's tutorials, they'll tell you all you need to know
    Harry.

    "From one thing, know ten thousand things."

  5. #5
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    I only made one tutorial and btw I'm still on it...

    However, thanks Harry :P

  6. #6
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Heh You still have the example programs though right?
    Harry.

    "From one thing, know ten thousand things."

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