diff options
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r-- | godot/scenes/Die.gd | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index 5e238f1..407f248 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -1,5 +1,7 @@ extends Spatial +const Game = preload("res://scenes/Game.gd") + var camrot_h = 0 var camrot_v = 0 var camrot_v_locked_val = 0 @@ -12,14 +14,24 @@ var dragging = false var mouse_origin = Vector2(0,0) var dice_launch_force = 0 +var _game: Game = null + # Called when the node enters the scene tree for the first time. func _ready(): Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) $CamRoot/Horizontal/Vertical/Camera.add_exception(self) $CamRoot.set_as_toplevel(true) + _game = get_node("/root/Game") func _input(event): + if event is InputEventKey: + if event.scancode == KEY_TAB: + if event.is_pressed(): + _game.open_scoreboard() + else: + _game.close_scoreboard() + if event is InputEventMouseMotion: camrot_h += -event.relative.x * sensitivity camrot_v += -event.relative.y * sensitivity |