I cant seem to keep my character on the platforms when he jumps or falls and he just phasses through them at times
any and all help would be appreciatable
private int speed = 5; private int vspeed = 0; private int accelaration = 1; private int acceleration = 1; private int jumpStreangth = 8;
/** * how we fall */ public void fall() { setLocation (getX(), getY() + vspeed); vspeed = vspeed += acceleration; } public boolean onGround() { Actor under = getOneObjectAtOffset(0, getImage().getHeight()/2, Platform.class); return under != null; } /** * how we fall */ public void checkFall() { if (onGround()) { vspeed = 0; } else { fall(); } } /** * how we jump */ public void jump() { vspeed = -jumpStreangth; fall(); }