lets-godot-roguelike
lets-godot-roguelike copied to clipboard
A tutorials series on how to build a simple roguelike in the Godot Game Engine
New scene. `res://game/things/Prop.tscn` Give it a script and an Icon (like Player). Have its script extend `Things.gd` In `_ready()` have it add to group "things" ( have Player add to...
New scene. `res://game/global/Database.tscn` Core node is `Node` "Database" Add this scene as singleton `Database` Core node holds functions for returning a duplicate of a node given its name and category....
We create another export var on `Thing.gd` `export( bool ) var blocks_movement = true` That is all.
Bring in Instances of Prop. You can modify their Icons and blocks_movement property. Create at least one of each and test.
Map gets `func get_things_in_cell( cell )` Step functions get these things and checks `if thing.blocks_movement`
We are going to construct our Player object directly in our Database scene. Go to that scene, bring in an instance of the Thing.tscn we just made. Clear its script,...
Create a new scene `res://global/things/Thing.tscn` Base is `Node2D` "Thing" Child `Sprite` "Icon" Migrate some of the code we have for the player over to this; everything except the _input() loop...
Re-save Player.tscn as `res://game/things/Player.tscn`. Clear its script and add a new one (auto-bitch!). Delete the old Player.tscn/.gd...re-save and delete is easier than move and rename in Godot. Replace script in...
All Things will share common properties and functions (mostly what we have in the player script ATM). We put these common things in a Thing.gd script `res://game/things/thing.gd`. This will have...
Thing.gd gets an `export(String, MULTILINE) var name = "Thing"` Also `func get_thing_name()` to return this name. Have `Map.step` print a string when you bump into a Thing `"You bump into...