Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
feat: add heads up display
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Feb 6, 2024
1 parent bc07cf3 commit a6ea89e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 40 deletions.
39 changes: 1 addition & 38 deletions game/characters/wizard/wizard.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[gd_scene load_steps=5 format=3 uid="uid://bqfj4dlx64q0r"]
[gd_scene load_steps=4 format=3 uid="uid://bqfj4dlx64q0r"]

[ext_resource type="Script" path="res://game/characters/wizard/wizard.gd" id="1_0rb7j"]
[ext_resource type="Texture2D" uid="uid://cequfnyxmgqtu" path="res://assets/sprites/wizard.png" id="2_nqjmu"]
[ext_resource type="Script" path="res://game/characters/wizard/rotation_point.gd" id="3_sw5yd"]

[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_t0s46"]

[node name="Wizard" type="CharacterBody2D"]
script = ExtResource("1_0rb7j")

Expand All @@ -20,41 +18,6 @@ texture = ExtResource("2_nqjmu")
[node name="Camera" type="Camera2D" parent="."]
zoom = Vector2(2, 2)

[node name="Juice" type="Label" parent="Camera"]
z_index = 999
offset_left = -316.0
offset_top = -197.0
offset_right = -244.0
offset_bottom = -145.0
text = "Juices: 20
"

[node name="Score" type="Label" parent="Camera"]
z_index = 999
offset_left = 220.0
offset_top = -199.0
offset_right = 315.0
offset_bottom = -173.0
text = "Score: 0
"
horizontal_alignment = 1

[node name="JuiceBackground" type="Panel" parent="Camera"]
z_index = 998
material = SubResource("CanvasItemMaterial_t0s46")
offset_left = -324.0
offset_top = -205.0
offset_right = -223.0
offset_bottom = -169.0

[node name="Button2" type="Panel" parent="Camera"]
z_index = 998
offset_left = 209.0
offset_top = -206.0
offset_right = 327.0
offset_bottom = -170.0

[node name="RotationPoint" type="Marker2D" parent="."]
visible = false
script = ExtResource("3_sw5yd")
Expand Down
27 changes: 27 additions & 0 deletions game/components/heads_up.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=3 uid="uid://ci4k3eyocn7g2"]

[ext_resource type="StyleBox" uid="uid://c2i2mjrwx7e" path="res://game/styles/hud_box.tres" id="1_4w0lt"]

[node name="HUD" type="CanvasLayer"]

[node name="ManaLabel" type="Label" parent="."]
offset_right = 262.0
offset_bottom = 146.0
theme_override_font_sizes/font_size = 40
theme_override_styles/normal = ExtResource("1_4w0lt")
text = "Mana: 20"
horizontal_alignment = 1
vertical_alignment = 1

[node name="ScoreLabel" type="Label" parent="."]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -262.0
offset_bottom = 146.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 40
theme_override_styles/normal = ExtResource("1_4w0lt")
text = "Score: 0"
horizontal_alignment = 1
vertical_alignment = 1
5 changes: 4 additions & 1 deletion game/levels/1.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://eui6qcwl2wdl"]
[gd_scene load_steps=7 format=3 uid="uid://eui6qcwl2wdl"]

[ext_resource type="TileSet" uid="uid://du4mlit2n1o7c" path="res://assets/tilesets/tiles.tres" id="1_6m48w"]
[ext_resource type="PackedScene" uid="uid://bqfj4dlx64q0r" path="res://game/characters/wizard/wizard.tscn" id="2_jk3qu"]
[ext_resource type="PackedScene" uid="uid://dxtj2socpdo5p" path="res://game/spawnables/rock/rock.tscn" id="3_ay7so"]
[ext_resource type="PackedScene" uid="uid://ci4k3eyocn7g2" path="res://game/components/heads_up.tscn" id="5_d0k0g"]
[ext_resource type="PackedScene" uid="uid://cxw6ee0kfg0yk" path="res://game/scenes/anti_math_juice/anti_math_juice.tscn" id="5_dhd8p"]

[sub_resource type="LabelSettings" id="LabelSettings_lff1f"]
Expand Down Expand Up @@ -81,3 +82,5 @@ position = Vector2(485, 69)
scale = Vector2(4, 4)
answer = 2
question = "1+1"

[node name="HUD" parent="." instance=ExtResource("5_d0k0g")]
5 changes: 4 additions & 1 deletion game/levels/tutorial.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://bimm0sh6fgcge"]
[gd_scene load_steps=11 format=3 uid="uid://bimm0sh6fgcge"]

[ext_resource type="TileSet" uid="uid://du4mlit2n1o7c" path="res://assets/tilesets/tiles.tres" id="1_ixvwr"]
[ext_resource type="PackedScene" uid="uid://bqfj4dlx64q0r" path="res://game/characters/wizard/wizard.tscn" id="2_gvfjw"]
Expand All @@ -7,6 +7,7 @@
[ext_resource type="PackedScene" uid="uid://cxw6ee0kfg0yk" path="res://game/scenes/anti_math_juice/anti_math_juice.tscn" id="5_76m1h"]
[ext_resource type="PackedScene" uid="uid://bve1ycnoxavc8" path="res://game/scenes/checkpoint/checkpoint.tscn" id="6_newtr"]
[ext_resource type="PackedScene" uid="uid://bkxaf8d4e86ux" path="res://game/scenes/portal/portal.tscn" id="7_cw3s8"]
[ext_resource type="PackedScene" uid="uid://ci4k3eyocn7g2" path="res://game/components/heads_up.tscn" id="8_c3tvq"]

[sub_resource type="LabelSettings" id="LabelSettings_3o51e"]
font = ExtResource("3_l5147")
Expand Down Expand Up @@ -163,3 +164,5 @@ position = Vector2(3562, 229)

[node name="SecretPortal" parent="." instance=ExtResource("7_cw3s8")]
position = Vector2(585, 100)

[node name="HUD" parent="." instance=ExtResource("8_c3tvq")]
9 changes: 9 additions & 0 deletions game/styles/hud_box.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://c2i2mjrwx7e"]

[resource]
bg_color = Color(0.6, 0.6, 0.6, 0.529412)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
shadow_size = 1

0 comments on commit a6ea89e

Please sign in to comment.