From f17a8bee92b7ab28206e64c7eb2398a311f73818 Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Mon, 6 May 2024 15:57:20 -0700 Subject: [PATCH] bosshealth --- levels/ui/gameplay.gd | 10 +++++----- levels/ui/tophud.tscn | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/levels/ui/gameplay.gd b/levels/ui/gameplay.gd index 9bc06e1..0e6d859 100644 --- a/levels/ui/gameplay.gd +++ b/levels/ui/gameplay.gd @@ -49,7 +49,7 @@ func _process(delta): Global.xm = 0 Global.ym = 0 var velocity = Vector2.ZERO - if Global.live == 1 && !Input.is_key_pressed(KEY_V) && !Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER): + if Global.live == 1 && !Input.is_action_pressed("schar"): if Input.get_joy_axis(0,JOY_AXIS_LEFT_X) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_X) < -0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) < -0.2: Global.xm = Input.get_joy_axis(0,JOY_AXIS_LEFT_X) Global.ym = Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) @@ -76,28 +76,28 @@ func _input(event): get_tree().change_scene_to_file("res://levels/ui/scene.tscn") else: get_tree().change_scene_to_file("res://title.tscn") - if (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_UP)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP))): + if Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_up"): if Global.debug: if Global.dparty[0][0] != null: Global.dcpchar = 0 else: if Global.party[0][0] != null: Global.cpchar = 0 - elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT))): + elif Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_right"): if Global.debug: if Global.dparty[1][0] != null: Global.dcpchar = 1 else: if Global.party[1][0] != null: Global.cpchar = 1 - elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN))): + elif Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_down"): if Global.debug: if Global.dparty[2][0] != null: Global.dcpchar = 2 else: if Global.party[2][0] != null: Global.cpchar = 2 - elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT))): + elif Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_left"): if Global.debug: if Global.dparty[3][0] != null: Global.dcpchar = 3 diff --git a/levels/ui/tophud.tscn b/levels/ui/tophud.tscn index 606f579..2d476c4 100644 --- a/levels/ui/tophud.tscn +++ b/levels/ui/tophud.tscn @@ -25,6 +25,45 @@ script = ExtResource("1_pntuv") [node name="CanvasLayer" type="CanvasLayer" parent="."] +[node name="Bossbg" type="ColorRect" parent="CanvasLayer"] +offset_left = 467.0 +offset_right = 708.0 +offset_bottom = 50.0 +color = Color(0.254902, 0.254902, 0.254902, 1) + +[node name="Boss" type="VBoxContainer" parent="CanvasLayer"] +offset_left = 467.0 +offset_right = 708.0 +offset_bottom = 50.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/Boss"] +layout_mode = 2 + +[node name="Label" type="Label" parent="CanvasLayer/Boss/HBoxContainer"] +custom_minimum_size = Vector2(174, 0) +layout_mode = 2 +text = "Name" + +[node name="HBoxContainer2" type="HBoxContainer" parent="CanvasLayer/Boss"] +layout_mode = 2 + +[node name="Label" type="Label" parent="CanvasLayer/Boss/HBoxContainer2"] +custom_minimum_size = Vector2(70, 0) +layout_mode = 2 +text = "Health" + +[node name="ProgressBar" type="ProgressBar" parent="CanvasLayer/Boss/HBoxContainer2"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ualpu") +theme_override_styles/fill = SubResource("StyleBoxFlat_patnr") + +[node name="Label2" type="Label" parent="CanvasLayer/Boss/HBoxContainer2"] +custom_minimum_size = Vector2(63, 0) +layout_mode = 2 +text = "100/100" +horizontal_alignment = 2 + [node name="Topminibg" type="ColorRect" parent="CanvasLayer"] offset_right = 377.0 offset_bottom = 116.0