Can't get player to jump properly

Apr 17, 2013 at 6:51pm
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. 
Apr 17, 2013 at 7:41pm
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 Apr 18, 2013 at 2:12am
Apr 17, 2013 at 7:55pm
yes one of them has, but i'm scared to ask him for help (he kinda intimidates me)
Topic archived. No new replies allowed.