© Andre Alves Garzia 2020
A. A. GarziaRoguelike Development with JavaScripthttps://doi.org/10.1007/978-1-4842-6059-3_4

4. Enemies and Permadeath

Andre Garzia1 
(1)
London, UK
 

Before we start to work on enemies and combat mechanics, we’re going to do a large refactor of our codebase. This will make it easier to work with multiple game entities such as enemies and monsters and introduce some new features from Phaser.

The new dungeon module will have more responsibilities than before as it will be used to manage both the level rendering and the game entity movements. Previously, our player class would change the dynamic layer tilemap directly when it needed to move. After our refactor, that class will call the functions provided by the dungeon module ...

Get Roguelike Development with JavaScript: Build and Publish Roguelike Genre Games with JavaScript and Phaser now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.