diff --git a/README.md b/README.md index 8486219..5091714 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ Puzzle game made by Tom for the Playmakers August Jam 2024 https://freesound.org/people/primeval_polypod/sounds/156507/ # new TODO -- [ ] when command blocks are propped they are placed as a root node, causing them to carry between rooms +- [x] when command blocks are propped they are placed as a root node, causing them to carry between rooms +- [ ] onscreen timer +- [ ] pedestal highlight should match clock - [ ] improve menu - [ ] swap out to developer name - [ ] make it a 3d environment with a rotating camera @@ -17,6 +19,7 @@ https://freesound.org/people/primeval_polypod/sounds/156507/ - [ ] pause menu on ESC - [ ] replace back to menu button - [ ] volume settings? +- [ ] website splash page for SMASH # old todo - [x] FPS Controller diff --git a/Scripts/ChronoManager.gd b/Scripts/ChronoManager.gd index eada8f8..a6a8550 100644 --- a/Scripts/ChronoManager.gd +++ b/Scripts/ChronoManager.gd @@ -36,6 +36,7 @@ var pedestals : Array[Pedestal] # Called when the node enters the scene tree for the first time. func _ready(): + tick.connect(gui.onTick) player.area.area_entered.connect(_player_area_entered) var temp_pedestals = pedstalContainer.get_children() for temp in temp_pedestals: diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 84b5cc0..3d75e93 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -127,7 +127,7 @@ func _input(event): func drop(): if has_object: - held_object.reparent(get_tree().get_root()) + held_object.reparent(get_parent()) held_object.freeze = false held_object.collider.disabled = false has_object = false diff --git a/Scripts/gui.gd b/Scripts/gui.gd index 363cb8b..8643acf 100644 --- a/Scripts/gui.gd +++ b/Scripts/gui.gd @@ -6,6 +6,8 @@ extends Control @export var reset_label : Label @export var start_level : PanelContainer @export var level_title : Label +@export var clock_progress : TextureProgressBar +@export var clock_label : Label var title_fade : float = 2.5 @@ -29,8 +31,17 @@ func show_lose_screen(lose_text : String, reset_timer : float): func hide_lose_screen(): lose_panel.visible = false + clock_progress.value = 0 + clock_label.text = str(0) pass func show_level_title(title : String): level_title.text = title title_fade = 2 + +func onTick(tick : int): + clock_progress.value = tick + if(tick == 11): + clock_label.text = str(10) + else: + clock_label.text = str(tick) diff --git a/Sprites/clock.pdn b/Sprites/clock.pdn new file mode 100644 index 0000000..0aac5da Binary files /dev/null and b/Sprites/clock.pdn differ diff --git a/Sprites/clockOff.png b/Sprites/clockOff.png new file mode 100644 index 0000000..3abfdeb Binary files /dev/null and b/Sprites/clockOff.png differ diff --git a/Sprites/clockOff.png.import b/Sprites/clockOff.png.import new file mode 100644 index 0000000..f8b1132 --- /dev/null +++ b/Sprites/clockOff.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dbjlesgbl3b5e" +path="res://.godot/imported/clockOff.png-d87647372261142486ea10a2e808d69f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/clockOff.png" +dest_files=["res://.godot/imported/clockOff.png-d87647372261142486ea10a2e808d69f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Sprites/clockOn.png b/Sprites/clockOn.png new file mode 100644 index 0000000..533a881 Binary files /dev/null and b/Sprites/clockOn.png differ diff --git a/Sprites/clockOn.png.import b/Sprites/clockOn.png.import new file mode 100644 index 0000000..ec163bc --- /dev/null +++ b/Sprites/clockOn.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bxqb0vw8nouea" +path="res://.godot/imported/clockOn.png-fc2c530b0fcad697dfb0078c2b7e77a6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/clockOn.png" +dest_files=["res://.godot/imported/clockOn.png-fc2c530b0fcad697dfb0078c2b7e77a6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/gui.tscn b/gui.tscn index cc24645..5767cfb 100644 --- a/gui.tscn +++ b/gui.tscn @@ -1,7 +1,9 @@ -[gd_scene load_steps=6 format=3 uid="uid://bnlexkofp68gv"] +[gd_scene load_steps=9 format=3 uid="uid://bnlexkofp68gv"] [ext_resource type="Script" uid="uid://co8tfbsod875o" path="res://Scripts/gui.gd" id="1_7s0l7"] [ext_resource type="Texture2D" uid="uid://buafet16thf3p" path="res://Assets/crosshair.png" id="1_mpwvh"] +[ext_resource type="Texture2D" uid="uid://dbjlesgbl3b5e" path="res://Sprites/clockOff.png" id="3_cor1f"] +[ext_resource type="Texture2D" uid="uid://bxqb0vw8nouea" path="res://Sprites/clockOn.png" id="4_u77ya"] [sub_resource type="LabelSettings" id="LabelSettings_lrnc3"] font_color = Color(1, 0, 0, 1) @@ -13,7 +15,13 @@ font_size = 60 font_size = 30 font_color = Color(0.662452, 0.662452, 0.662452, 1) -[node name="Gui" type="Control" node_paths=PackedStringArray("lose_panel", "lose_label", "reset_label", "start_level", "level_title")] +[sub_resource type="LabelSettings" id="LabelSettings_cor1f"] +font_size = 31 +font_color = Color(0.686086, 0.00014728, 0.612691, 1) +outline_size = 8 +outline_color = Color(0.658824, 1, 1, 1) + +[node name="Gui" type="Control" node_paths=PackedStringArray("lose_panel", "lose_label", "reset_label", "start_level", "level_title", "clock_progress", "clock_label")] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -26,6 +34,8 @@ lose_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseText") reset_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseTimer") start_level = NodePath("MarginContainer/StartPanel") level_title = NodePath("MarginContainer/StartPanel/VBoxContainer/LevelTitle") +clock_progress = NodePath("ClockProgress") +clock_label = NodePath("ClockProgress/CenterContainer/Label") [node name="Label" type="Label" parent="."] visible = false @@ -93,3 +103,27 @@ layout_mode = 2 text = "Resetting in: 3.0" label_settings = SubResource("LabelSettings_rdkfa") horizontal_alignment = 1 + +[node name="ClockProgress" type="TextureProgressBar" parent="."] +layout_mode = 2 +offset_left = 10.0 +offset_top = 10.0 +offset_right = 74.0 +offset_bottom = 74.0 +scale = Vector2(2, 2) +max_value = 10.0 +fill_mode = 4 +texture_under = ExtResource("3_cor1f") +texture_progress = ExtResource("4_u77ya") + +[node name="CenterContainer" type="CenterContainer" parent="ClockProgress"] +layout_mode = 1 +offset_left = -0.5 +offset_top = -0.5 +offset_right = 63.5 +offset_bottom = 63.5 + +[node name="Label" type="Label" parent="ClockProgress/CenterContainer"] +layout_mode = 2 +text = "0" +label_settings = SubResource("LabelSettings_cor1f") diff --git a/player.tscn b/player.tscn index bf8344f..cbe2284 100644 --- a/player.tscn +++ b/player.tscn @@ -14,7 +14,6 @@ radius = 0.47 height = 1.9 [node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast", "hand", "collider", "area", "interact_sound", "dash_node")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83982, 0) script = ExtResource("1_tc5d2") camera = NodePath("Camera3D") raycast = NodePath("Camera3D/RayCast3D")