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?
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.
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?
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.
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
Paramvir (September 26th, 2014)
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!