hey everyone,
i´m kind of a noob in programming, because my teacher hasnt taught me anything so i dont know how to make a charater jump.
private int gravity;
public void act()
{
gravity--;
setLocation(getX(), getY() - gravity);
checkForJump();
}private void checkForJump()
{
Actor a = getOneIntersectingObject(Trampoline.class);
if (a != null) {
gravity = 20; // this will make the character jump
}
}if (onGround && Greenfoot.isKeyDown("space"))