Hi, I'm making a game where I want "monsters" (Monsters.class) to be moving back and forth between walls. The wall is another class of object (Wall.class). My problem is that I can't have the monster change direction when it hits a wall without the image flipping upside down.
Right now my code in the monster's act method looks like this:
if(!isTouching(Wall.class))
move(1);
else if (isTouching(Wall.class))
{
turn(180);
move(5);
}
I was also wondering if there's a way to make it so that the monster doesn't have to move a greater distance (5 currently) after it turns, because right now if I make it move just 1 or even 3 pixels, the monster will still be touching the wall and end up turning indefinitely in one spot.
Any help would be appreciated!

