I want to make a grid-based-movement puzzle game. The rules are simple - player must go to exit, but when he’s on the same line (horizontally or vertically) as an enemy, and there is no any rocks etc. between them, the enemy starts to chase the player (also one square per one player’s move, turn-based-like).
I don’t know how to program and I thought it could be easy to make such a game but I don’t know how to do this. Could somebody help?
You’ll want to put an boolean object variable on the enemy object (say call it “IsChasing”)
Then you’ll need to add an event to check the whether the enemy’s column or row is the same as the player, and if it is then set the IsChasing variable to True.
In the event that moves the player, add a subevent to move enemies that have the IsChasing variable set to True.
You can make the background a sprite of just one of the grid cells and then tile it. This will allow you to change the dimensions of the game without having to rescale the background. Also, it will take up less memory (particularly good for low memory devices).