Can't get player to jump properly

OK so i need to try and make my player jump, and although i can him to move upwards on a keypress i have no idea how to get him to come back down on his own (basically implement gravity

The code below is what i use to move the character upwards on key press, i can't work out hwo to implement gravity, want to use Y pos as much as possible, don't want to cahg e to using VelY if i can help it

 
p1.setYpos(p1.getYpos() - 15); // Allows player to jump upwards. 
closed account (D80DSL3A)
Have any of your classmates been able to avoid using VelY?
I'd like to help, but I can't imagine any simple method which would avoid that.
Last edited on
yes one of them has, but i'm scared to ask him for help (he kinda intimidates me)
Topic archived. No new replies allowed.