hey there,
i'm new to greenfoot and to pragramming in general.
i started editing the wombat scenario to get some expertise but know i've got a problem i'm not able to solve. i want my actors to check wether they can move or not and got some code written which (to me) seems to be correct, but greenfoot says "non-static method getX() cannot be referenced from a static context" and i don't know why.
do you know a good solution for this or maybe another way to solve my problem with the obstacle checking?
my code so far:
the problem is, i don't know how to check wether the position of my actor (after moving) would be the same as the obstacle's one.
public boolean canMove() { World myWorld = getWorld(); int x = getX(); int y = getY(); if(x = Obstacle.getX() || y = Obstacle.getY()) { return false; } else { return true; } }