This site requires JavaScript, please enable it in your browser!
Greenfoot back
GaijinVagabond
GaijinVagabond wrote ...

2018/7/23

Jump/Fall

GaijinVagabond GaijinVagabond

2018/7/23

#
I found a really helpful post from a while back to help me figure out how to make a character jump. However I can't figure out how to make it treat a specific point on the y axis as the ground level instead of the bottom of the screen. I'm using a 600 x 400 world and would like to make the ground level 336 if that helps.Here's the old post
Super_Hippo Super_Hippo

2018/7/23

#
I guess you should change that line:
int groundLevel = getWorld().getHeight() - getImage().getHeight()/2;
If 336 is the desired y-coordinate, it will look like that:
int groundLevel = 336 - getImage().getHeight()/2;
GaijinVagabond GaijinVagabond

2018/7/23

#
Thanks for the help! I'm new to this so I have no idea what I'm doing.
You need to login to post a reply.