Adding some splosions


Added a quick and janky splosion animation for the enemies when they are supposed to explode and added a trigger sploding when a direct neighbour explodes. Working through this and testing it has exposed some issues in the movement that I've setup. These can all be resolved by making the stages of the movement discrete states. Right now it's kind of a weird hodgepodge of semi-discrete states.

For example, the enemies will first pick their next position. Once all enemies have chosen their next position they will move to that position. After moving it will check to see if the player is in a connecting tile. If so, splode. This will send a message which will trigger other enemies to check if they are within the splosion radius. If so, they also splode.

Even within in that we go from discrete action states to an asynchronous message handler that may or may not perform additional behaviour. It's not ideal.

On top of that, the only thing preventing the player from moving is whether they are currently in a moving animation. Technically, sure, if they're moving they can't move again until that's completed. However, enemies don't do any of their actions until the player has chosen a next tile. With enemy movements you can get into a position where you can move the player slightly faster than the enemies. Instead of the player being able to escape, this allows the enemies to plot additional movements, which can trigger a splosion across a tile gap. Since I'm not checking if the player is within the splosion radius, that counts as a death and resets the level. 

Definitely broken, but it should be relatively easy to fix by implementing discrete action states and ensuring all entities are locked to these states.  Something like an action state, movement state, splosion check state, restart level. That should cover it, but I'll worry about it when I come back to this tomorrow.

Files

game.zip Play in browser
18 hours ago

Leave a comment

Log in with itch.io to leave a comment.