Log 4
Refactoring to use engine state
I want to say this took much longer than i expected it too, but it actually took much longer than I wanted it too. I finally got everything compiling now though and I have engine working with state transitions.
Fire, Lightning, and Confusion Spells
All the spells are implemented and working well. Fire and confusion spells use a lambda call back function that enables the targeting system. They probably cause way too much damage, but this is just a tutorial run through so I can live with it.
Dropping items
When scrolling through the inventory it's now possible to drop items by using d, RETURN will use an item, and q will quit.
Refactoring
The big refactors in this one were the engine transition to the state pattern. Actions in the game now return a StateResult that switches the behaviour of the game. It removes the need for a bunch of flags like `is_paused` or even holding references to the current UI Window. Everything is much neater and self contained.
Whats next?
The next phase of the tutorials of course! That is, saving the game state. Actually really looking forward to implementing this.
Get Yet Another Roguelike tutorial with C++ and Libtcod
Yet Another Roguelike tutorial with C++ and Libtcod
Status | Prototype |
Category | Other |
Author | daniebker |
Tags | cpp, Game engine, libtcod, Roguelike, roguelikedev |
Leave a comment
Log in with itch.io to leave a comment.