Battling Through to the Exit

Develop our game further to include challenges for the player.

Our game needs a challenge, or it won’t be fun. A challenge will reduce the chances of the player winning and let them feel like they overcame something when they do win.

For our challenge, we’ll implement a room with an enemy. The hero and the enemy will fight, and the first one to reach zero hit points is defeated. We need to build a list of enemies, create functions to reduce and restore character hit points, build a battle module, and create a room that can trigger a battle. Once we have a room-trigger contract, we need to follow it strictly.

Get hands-on with 1200+ tech skills courses.