From 3f78b986b18c409164cc56752a8cfba7663a5028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Gro=C3=9F?= Date: Sat, 18 Nov 2017 11:51:50 +0100 Subject: [PATCH] Control port 1.1 --- scenes/missile.tscn | 2 +- scripts/base.gd | 5 +++++ stages/main_stage.tscn | 7 ++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scenes/missile.tscn b/scenes/missile.tscn index b5dd694..33d4d63 100644 --- a/scenes/missile.tscn +++ b/scenes/missile.tscn @@ -18,7 +18,7 @@ collision/layers = 1 collision/mask = 1 collision/margin = 0.08 script/script = ExtResource( 1 ) -speed_mult = 180 +speed_mult = 200 [node name="MissileSprite" type="Sprite" parent="."] diff --git a/scripts/base.gd b/scripts/base.gd index 838abbd..b1c35e4 100644 --- a/scripts/base.gd +++ b/scripts/base.gd @@ -20,6 +20,9 @@ func _ready(): func _process(delta): state.update(delta) +func _fixed_process(delta): + if state.has_method("fixed_update"): + state.fixed_process(delta) func _input(event): print(event.type) @@ -90,6 +93,8 @@ class StateAiming: #var mouse_pos = base.get_global_mouse_pos() #cannon.look_at(mouse_pos) #cannon.set_rot(cannon.get_global_pos().angle_to_point(mouse_pos)) + + func fixed_process(delta): base.cannon_rotation += base.cannon_rot_dir cannon.set_rot(deg2rad(base.cannon_rotation)) diff --git a/stages/main_stage.tscn b/stages/main_stage.tscn index 48ff5ef..1bf8dda 100644 --- a/stages/main_stage.tscn +++ b/stages/main_stage.tscn @@ -92,9 +92,10 @@ func anim_finished(): print(\"SETTING QTIME SACALE\") OS.set_time_scale(0) -func on_button_clicked(): - OS.set_time_scale(1) - hide() +func _input(event): + if(event.is_action_pressed(\"Coin\")): + OS.set_time_scale(1) + hide() " [node name="Node" type="Node"]