lets-godot-roguelike
lets-godot-roguelike copied to clipboard
A tutorials series on how to build a simple roguelike in the Godot Game Engine
The standard method of performing a melee attack against an enemy in a roguelike is to "bump into" them; that is, attempt to step into the cell they occupy. In...
The Fighter component will be where our script inheritance system for Things will start to work for us. Fighter will extend Thing, and provide all members and methods for a...
First we need a `var discovered=false` property of Thing. All Things begin undiscovered, and become discovered the first time they enter a FOVmap. Next, Things get an `export(bool) var always_visible...
When the player changes map position, calculate a FOVmap, which should be an array of `Vector2` map cells which are considered "visible". Iterate through all nodes in the "things" group...
FOV.gd will be another singleton script. It will take the map data from our DataMap object and calculate the fov of an origin cell within a range. The script will...
Whenever the player's Thing has its map pos set via its `set_map_pos()` function, emit the map_pos_changed signal. The script in charge of drawing FOV will connect to this signal, and...
Use a setter method to hide/show the Thing's sprite when its visibility changes.