diff --git a/scenes/ability_icon.tscn b/scenes/ability_icon.tscn index 3f2b208..641ba31 100644 --- a/scenes/ability_icon.tscn +++ b/scenes/ability_icon.tscn @@ -8,7 +8,7 @@ content_margin_left = -1.0 content_margin_right = -1.0 content_margin_top = -1.0 content_margin_bottom = -1.0 -bg_color = Color( 0.0297089, 0.230469, 0.206942, 1 ) +bg_color = Color( 0.042572, 0.351562, 0.315353, 1 ) draw_center = true border_width_left = 0 border_width_top = 0 @@ -64,10 +64,8 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = -6.0 -margin_top = -4.0 -margin_right = 5.0 -margin_bottom = 5.0 +margin_right = 30.0 +margin_bottom = 30.0 rect_pivot_offset = Vector2( 0, 0 ) mouse_filter = 0 mouse_default_cursor_shape = 0 @@ -85,10 +83,10 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = -20.0 -margin_top = -21.0 -margin_right = 30.0 -margin_bottom = 28.0 +margin_left = -25.0 +margin_top = -25.0 +margin_right = 25.0 +margin_bottom = 25.0 rect_pivot_offset = Vector2( 0, 0 ) mouse_filter = 0 mouse_default_cursor_shape = 0 @@ -111,10 +109,10 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = -25.0 -margin_top = -26.0 -margin_right = 25.0 -margin_bottom = 23.0 +margin_left = -30.0 +margin_top = -30.0 +margin_right = 20.0 +margin_bottom = 20.0 rect_pivot_offset = Vector2( 0, 0 ) mouse_filter = 0 mouse_default_cursor_shape = 0 @@ -128,10 +126,10 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = -68.0 -margin_top = -49.0 -margin_right = 74.0 -margin_bottom = -35.0 +margin_left = -72.0 +margin_top = -44.0 +margin_right = 70.0 +margin_bottom = -30.0 rect_pivot_offset = Vector2( 0, 0 ) mouse_filter = 2 mouse_default_cursor_shape = 0 @@ -150,10 +148,10 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = -68.0 -margin_top = 38.0 -margin_right = 74.0 -margin_bottom = 52.0 +margin_left = -72.0 +margin_top = 29.0 +margin_right = 70.0 +margin_bottom = 43.0 rect_pivot_offset = Vector2( 0, 0 ) mouse_filter = 2 mouse_default_cursor_shape = 0 diff --git a/scenes/heroes/0.tscn b/scenes/heroes/0.tscn index ef679a0..4119ca7 100644 --- a/scenes/heroes/0.tscn +++ b/scenes/heroes/0.tscn @@ -24,7 +24,7 @@ mesh = ExtResource( 4 ) text = "" -[node name="ProgressBar" parent="MasterOnly" index="1" instance=ExtResource( 5 )] +[node name="Boost" parent="MasterOnly" index="1" instance=ExtResource( 5 )] anchor_left = 1.0 anchor_top = 1.0 diff --git a/scripts/ability_icon.gd b/scripts/ability_icon.gd index f83f230..886f9db 100644 --- a/scripts/ability_icon.gd +++ b/scripts/ability_icon.gd @@ -28,7 +28,14 @@ func _ready(): description = "" get_node("Button").text = description +func is_pressed(): + return Input.is_action_pressed(action) + func _process(delta): + if action and Input.is_action_pressed(action): + available.rect_position = Vector2(-25, -25) # Centered / not offset + else: + available.rect_position = Vector2(-30, -30) if disabled: available.hide() bar.value = 0 diff --git a/scripts/heroes/0.gd b/scripts/heroes/0.gd index d2c4110..8818133 100644 --- a/scripts/heroes/0.gd +++ b/scripts/heroes/0.gd @@ -24,7 +24,7 @@ func control_player(state): var boost_strength = 2 var boost_drain = 25 # Recall increased charge must be factored in var cost = boost_drain * state.step - if Input.is_action_pressed("hero_0_boost") and switch_charge > cost: + if get_node("MasterOnly/Boost").is_pressed() and switch_charge > cost: walk_speed *= 2 air_accel *= 3 switch_charge -= cost