So by now I erached a point in my game where i have to place some enemies in a stage to test if their behavior does what it's supposed to do. So today i tried making a bat.
The bat hangs on the ceiling and sleeps. if the player comes close, the bat wakes up and flies around frantically. it tries to get the player, so if the player is out of range (aka turret range) the bat flies somewhere else until the player gets in range again. If the player hits the bat it dies.
So far everything i described here works like a charm. Here's what I did:
i created a enemy box. since i dont want the bat to titl at any angle but till fly in any angle, i gave the box all functions and simply attached a bat sprite to the box. the sprite has two animations: sleep and fly. so for starters they sleep nd then they fly. This, as wll, works perfectly.
Now here is my problem though:
once ONE bat starts to fly, ALL bats start their fly animation, even though they still sleep. furthermore, once all bats aredefeated, the last bat i kill is NOT disappearing. its gone, technically but the sprite still shows and has the fly animation on loop.
i did this:
<img src="http://www.ezekiel-rage.com/images/problem2.png" border="0" />