lets-godot-roguelike
lets-godot-roguelike copied to clipboard
A tutorials series on how to build a simple roguelike in the Godot Game Engine
Up until now, we've not concerned ourselves with what happens in between our players actions. We want to craft our game to use a kind of turn-based system, where all...
Things with an AI will receive a Brain Node as one of its children. Create a new scene; base `Node` "Brain" as `res://things/Brain.tscn` Script it. Its first method: `func take_turn():`...
We will write yet another global script, this time to handle the pathfinding for our soon-to-be Artificial Intelligence! This script will utilize Godot's AStar class, and use some of its...
 This image doesn't illustrate this well. There should be other blocking Things affecting the path. The idea is to, instead of generating a PathMap for the entire dungeon and...
With that we should now have three characteristic variables that make up our Fighter: Health (HP), Strength(attack), and Resistance(defense). With even just these (and some graphics), you could create a...
To make combat interesting, we can incorporate a couple variables into the damage factor of our attacks. Fighter script gets: `export(int) var attack = 2` `export(int) var defense = 2`...
Where we put our placeholder print statement in the bump-fighting portion of our step method, replace with `self.attack( other_fighter )`.
These methods go under Fighter. `func attack( target ):` Calls take_damage() on `target` `take_damage( amount ):` subtracts `amount` from current HP, and sets the new HP.
Hitpoints should require little explanation. Fighter should have two vars: `export(int) var max_HP = 10` `var HP = 10 setget _set_HP` We will do some work with our HP var....
Create a new instance of the Thing base object in our Database and give it the Fighter script. This will be the base Fighter object we'll use for non-player fighters....