I'm kind of a newby with greenfoot, so maybe someone can help me with this!
I've got a player, which has to stand on the ground (Ground.class), but also on a moving platform called Platform.class.
My code is:
So now there is only Ground.class in my code, but I want to add Platform.class too.
But if I replace Ground.class by null, my character also stands on the grass (Grass.class), and I don't want that!
I hope someone can help me with this problem.
Thanks in advance!
public boolean onGround() { Object under = getOneObjectAtOffset ( 0, getImage().getHeight() / 2, Ground.class); return under != null; }