Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: 2D game Jumping Help

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 2D game Jumping Help

    I'm programming a game and can't seem to find a way to jump, so could someone tell me the code for it or have a link to a good video?


  2. #2
    Junior Member
    Join Date
    Apr 2014
    Posts
    22
    My Mood
    Lonely
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    Please post code where your issue is. How can we help you if we dont have information? Please send the code you have problems with so we can help you.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: 2D game Jumping Help

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    1. Stand up straight
    2. Bend deeply at the knees and waist, coiling up as close to floor as possible
    3. Spring explosively back to the stand up position, reaching for the sky

  4. The Following User Says Thank You to GregBrannon For This Useful Post:

    Paramvir (September 26th, 2014)

  5. #4
    Junior Member
    Join Date
    Dec 2013
    Location
    British Columbia, Canada
    Posts
    6
    My Mood
    Busy
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: 2D game Jumping Help

    Well, its not that hard. I'll explain it in pseudo-code:

    - KeyEvent from user stating jump action
    - Get player coordinates
    - Add half+ of the gravity amount to the jump above

    So in your player class, have a method like jump() ?

    And as above, make sure you provide lots of detail about your question if you'd like to get it solved!

Similar Threads

  1. Jumping Issue
    By MiningManCoder in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 31st, 2014, 06:52 PM
  2. Jumping Ship
    By dalesgent in forum The Cafe
    Replies: 3
    Last Post: August 9th, 2013, 06:20 AM
  3. testing is player is jumping or not jumping. falling or not falling.
    By hwoarang69 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 11th, 2012, 06:07 PM
  4. Frog jumping code (AP comp science help!)
    By CompScienceStudent1 in forum What's Wrong With My Code?
    Replies: 14
    Last Post: September 21st, 2011, 05:42 PM
  5. Cant get my code to stop jumping
    By Mob31 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 2nd, 2011, 07:03 AM