This repository has been archived on 2020-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
2020-07-06 22:00:39 +00:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
class_name GameInstance
|
|
|
|
|
2020-07-10 00:09:54 +00:00
|
|
|
onready var ui = $CanvasLayer/ui
|
2020-07-10 08:45:57 +00:00
|
|
|
onready var world = $world
|
2020-07-08 22:12:14 +00:00
|
|
|
onready var systems = $systems
|
2020-07-06 22:00:39 +00:00
|
|
|
|
|
|
|
func _ready():
|
|
|
|
ui.connect("command", world, "process_command")
|
|
|
|
|
|
|
|
func process_command(cmd: UICommand):
|
|
|
|
match cmd.cmd_type:
|
|
|
|
UICommand.CommandType.SetShipSpeed:
|
|
|
|
world.map.ship_speed = cmd.cmd_args[0]
|
|
|
|
UICommand.CommandType.SetShipDirection:
|
|
|
|
world.map.ship_direction = cmd.cmd_args[0]
|