Results 1 to 3 of 3

Thread: Jumping

  1. #1

    Thread Starter
    Lively Member Brinith's Avatar
    Join Date
    Feb 2012
    Location
    Near you
    Posts
    116

    Jumping

    I am currently making a small flood runner like game, I completed most of it, but I can't seem to get the jump action right. I got it to jump straight up and back down again, but it doesn't work when I use a left/right arrow key with it to perform a left/right jump.

    The sprite goes straight up if I only press space.
    What I want-
    The sprites goes up and right or left when I press space while holding right or left.
    "When ideas and actions fuse, they form creations"

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,296

    Re: Jumping

    As you haven't said otherwise, I'm going to assume that you're using WinForms.

    You would have to handle the KeyDown and KeyUp events so that you know when the user has depressed and released the arrow keys. You can then store their state in Boolean variables. When the user depresses the space bar you simply test those Boolean variable to know whether to jump left, right or straight up.

  3. #3
    Fanatic Member proneal's Avatar
    Join Date
    May 2011
    Posts
    762

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