java 2d game how to make a player jump

Posted by user2957632 on Game Development See other posts from Game Development or by user2957632
Published on 2013-11-10T08:46:50Z Indexed on 2013/11/10 10:18 UTC
Read the original article Hit count: 201

Filed under:

Hi I'm making a 2d plat former running game kind of like jetpack joyride fro example were u are constantly running but there is obstacles and u need to jump over them. but I want the character to jump and come back down. here is some of my code.

                         if (listen.ml == true) {
            if (y > 120) {
                jump = true;
                y -= 1;
            }

        }
        if (y == 121 &&  jump == true) {
            jump = false;
        y += 1;
        }

© Game Development or respective owner

Related posts about java