Okay guys! I am back again… there is a surprise!
Anyway, really simple brief run down, I have a level, hero, blocks and now a moving enemy. The enemy starts moving left, and when the enemy hits a block it turns around and moves the other way. The problem is, when it hits a block again it goes through it. I think I need another boolean or I am using the switch like set up incorrectly. I know there are basic switch boolean formulas, but I wanted to see what you guys thought, here is all the update code for my enemy! Let me know what you think, the boolean starts as false.
if (isHit == false)//if false move left
{
x -= power;
}
if (isHit == true)//if true move right
{
x += power;
}
if (collide("wall", x, y) && isHit == false)
{
isHit = true;
}