moved direction enum into a global node

This commit is contained in:
Zac 2019-08-07 23:50:32 -04:00
parent 2ceab0d455
commit 248eec59cc
3 changed files with 12 additions and 7 deletions

View File

@ -19,6 +19,10 @@ config/name="Textual Royale"
run/main_scene="res://scenes/Game.tscn"
config/icon="res://images/icon.png"
[autoload]
Globals="*res://scripts/Globals.gd"
[display]
window/size/resizable=false

8
scripts/Globals.gd Normal file
View File

@ -0,0 +1,8 @@
extends Node
enum Directions {
N = 1,
S = 2,
E = 4,
W = 8
}

View File

@ -8,13 +8,6 @@ onready var ExitsDisplay = $Information/Exits/Exits
var RoomController = preload("res://scripts/RoomController.gd").new()
var LocalPlayer = preload("res://scripts/PlayerInfo.gd").new()
enum Directions {
N = 1,
S = 2,
E = 4,
W = 8
}
# key is command as written by user
# value is the function name that should be executed
# (note, the function should accept a string that contains the arguments to the command)