Jumping-VBForums
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
    114

    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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    87,257

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.