i have 3 class. hero, monster, and wall class.
if hero is touching monster, it will "move the hero"
but if "move the hero" will result hero touching the wall, it dont move it.
how i can make this?
sorry for my bad english
if (isTouching(Monster.class))
{
//move hero
move(-2);
if (isTouching(Wall.class))
{
move(2);
}
}