Results 1 to 3 of 3

Thread: Jumping

  1. #1

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


    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
    Sydney, Australia

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.