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


Welcome to my page

student1's scenarios

This user has not made any scenarios.

student1's collections

This user has no collections

Recent Comments | Show All

this is the gravity code i'm using
public void Gravity() { int groundLevel = getWorld().getHeight() - getImage().getHeight()/2; boolean onGround = (getY() == groundLevel); if (!onGround) { ySpeed++; setLocation(getX(), getY()+ySpeed); if (getY()>=groundLevel) { setLocation(getX(), groundLevel); Greenfoot.getKey(); } } else { if ("space".equals(Greenfoot.getKey())) { ySpeed = -15; setLocation(getX(), getY()+ySpeed); } } }