Open comments for this post
Added enemy class, which has methods for its movement algorithm, and an entity scanning method, which iterates through the towerLayout array and checks if the range of that tower will damage the enemy, and subtracts that damage from it. The method also checks if there are towers within range of the enemy, (3x3 square centred about the enemy) and does damage to those towers as well.
If the enemy makes it to the end of the board, it will do damage to the player until it dies or the player dies, ending the game.
Open comments for this post
Added classes for the cursor (represented as an _ ), player and tower.
The player class has credits to build towers and a health attribute which would depend on whether enemies finish the path through the board.
The tower superclass has attributes for its position, its damage per second, range and health. There are three subclasses for types of towers (represented by ▲, ✸, ◎) which each have different attributes and prices.
The cursor moves in each cardinal direction and will not move outside the walls or write over any towers. It has the same interface as the path direction (0 for North - 3 for West) and 6, 7 and 8 to place towers.
Open comments for this post
Simple board gen algorithm completed, the cardinal direction of play (0 for North - 3 for West) as well as the dimensions of the board, 5x5, 7x7 etc.