diff --git a/growth/level.tscn b/growth/level.tscn index cd651f0..e1002f4 100644 --- a/growth/level.tscn +++ b/growth/level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=3 format=3 uid="uid://bmatavjyacfwg"] +[gd_scene load_steps=3 format=3 uid="uid://c5qbqj52kr0aw"] [ext_resource type="PackedScene" uid="uid://dhhnr3xkxbxlu" path="res://player.tscn" id="1_vonw3"] [ext_resource type="PackedScene" uid="uid://bsv3h2lpv7h77" path="res://virus.tscn" id="2_oi3di"] diff --git a/growth/player.gd b/growth/player.gd index b070520..7a6227a 100644 --- a/growth/player.gd +++ b/growth/player.gd @@ -31,15 +31,16 @@ var dash_cooldown_timer = 0; var dash_on_cooldown = false; func update_move_direction(): - if Input.is_action_pressed("move_right"): - move_direction.x += 1 - if move_direction.is_action_pressed("move_left"): - move_direction.x -= 1 - if Input.is_action_pressed("move_down"): - move_direction.y += 1 - if Input.is_action_pressed("move_up"): - move_direction.y -= 1 - move_direction = move_direction.normalize() + move_direction = Vector2.ZERO + if Input.is_action_pressed("move_right"): + move_direction.x += 1 + if Input.is_action_pressed("move_left"): + move_direction.x -= 1 + if Input.is_action_pressed("move_down"): + move_direction.y += 1 + if Input.is_action_pressed("move_up"): + move_direction.y -= 1 + move_direction = move_direction.normalized() func update_target_coords(): target = get_viewport().get_mouse_position() @@ -56,7 +57,7 @@ func charge(): charge_level = max(charge_level - charge_rate * 2, 0); func dash(): - var card = hand[active_card_index]; + var card = hand.get(active_card_index); if not card or dash_on_cooldown: return; @@ -139,6 +140,3 @@ func _process(delta): elif Input.is_action_just_pressed("cycle_card_right"): action_state = ActionState.Cycling; cycle_card(1); - elif Input.is_action_pressed("charge"): - action_state = ActionState.Charging; - charge(); diff --git a/growth/project.godot b/growth/project.godot index 0542b9a..c3aba4e 100644 --- a/growth/project.godot +++ b/growth/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="growth" -run/main_scene="uid://bmatavjyacfwg" +run/main_scene="uid://dhhnr3xkxbxlu" config/features=PackedStringArray("4.5", "GL Compatibility") config/icon="res://icon.svg" @@ -37,16 +37,6 @@ move_up={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) ] } -dash={ -"deadzone": 0.2, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) -] -} -play_card={ -"deadzone": 0.2, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) -] -} cycle_card_left={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null) @@ -57,6 +47,16 @@ cycle_card_right={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) ] } +play_card={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) +] +} +dash={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} [rendering]