clock gui and command block fix

This commit is contained in:
Tabby 2025-05-25 14:31:14 +10:00
parent 864f62d5b4
commit a9be913adb
11 changed files with 121 additions and 5 deletions

View file

@ -8,7 +8,9 @@ Puzzle game made by Tom for the Playmakers August Jam 2024
https://freesound.org/people/primeval_polypod/sounds/156507/ https://freesound.org/people/primeval_polypod/sounds/156507/
# new TODO # 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 - [ ] improve menu
- [ ] swap out to developer name - [ ] swap out to developer name
- [ ] make it a 3d environment with a rotating camera - [ ] 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 - [ ] pause menu on ESC
- [ ] replace back to menu button - [ ] replace back to menu button
- [ ] volume settings? - [ ] volume settings?
- [ ] website splash page for SMASH
# old todo # old todo
- [x] FPS Controller - [x] FPS Controller

View file

@ -36,6 +36,7 @@ var pedestals : Array[Pedestal]
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
tick.connect(gui.onTick)
player.area.area_entered.connect(_player_area_entered) player.area.area_entered.connect(_player_area_entered)
var temp_pedestals = pedstalContainer.get_children() var temp_pedestals = pedstalContainer.get_children()
for temp in temp_pedestals: for temp in temp_pedestals:

View file

@ -127,7 +127,7 @@ func _input(event):
func drop(): func drop():
if has_object: if has_object:
held_object.reparent(get_tree().get_root()) held_object.reparent(get_parent())
held_object.freeze = false held_object.freeze = false
held_object.collider.disabled = false held_object.collider.disabled = false
has_object = false has_object = false

View file

@ -6,6 +6,8 @@ extends Control
@export var reset_label : Label @export var reset_label : Label
@export var start_level : PanelContainer @export var start_level : PanelContainer
@export var level_title : Label @export var level_title : Label
@export var clock_progress : TextureProgressBar
@export var clock_label : Label
var title_fade : float = 2.5 var title_fade : float = 2.5
@ -29,8 +31,17 @@ func show_lose_screen(lose_text : String, reset_timer : float):
func hide_lose_screen(): func hide_lose_screen():
lose_panel.visible = false lose_panel.visible = false
clock_progress.value = 0
clock_label.text = str(0)
pass pass
func show_level_title(title : String): func show_level_title(title : String):
level_title.text = title level_title.text = title
title_fade = 2 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)

BIN
Sprites/clock.pdn Normal file

Binary file not shown.

BIN
Sprites/clockOff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

View file

@ -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

BIN
Sprites/clockOn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

View file

@ -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

View file

@ -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="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://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"] [sub_resource type="LabelSettings" id="LabelSettings_lrnc3"]
font_color = Color(1, 0, 0, 1) font_color = Color(1, 0, 0, 1)
@ -13,7 +15,13 @@ font_size = 60
font_size = 30 font_size = 30
font_color = Color(0.662452, 0.662452, 0.662452, 1) 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 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -26,6 +34,8 @@ lose_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseText")
reset_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseTimer") reset_label = NodePath("MarginContainer/PanelContainer/VBoxContainer/LoseTimer")
start_level = NodePath("MarginContainer/StartPanel") start_level = NodePath("MarginContainer/StartPanel")
level_title = NodePath("MarginContainer/StartPanel/VBoxContainer/LevelTitle") level_title = NodePath("MarginContainer/StartPanel/VBoxContainer/LevelTitle")
clock_progress = NodePath("ClockProgress")
clock_label = NodePath("ClockProgress/CenterContainer/Label")
[node name="Label" type="Label" parent="."] [node name="Label" type="Label" parent="."]
visible = false visible = false
@ -93,3 +103,27 @@ layout_mode = 2
text = "Resetting in: 3.0" text = "Resetting in: 3.0"
label_settings = SubResource("LabelSettings_rdkfa") label_settings = SubResource("LabelSettings_rdkfa")
horizontal_alignment = 1 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")

View file

@ -14,7 +14,6 @@ radius = 0.47
height = 1.9 height = 1.9
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast", "hand", "collider", "area", "interact_sound", "dash_node")] [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") script = ExtResource("1_tc5d2")
camera = NodePath("Camera3D") camera = NodePath("Camera3D")
raycast = NodePath("Camera3D/RayCast3D") raycast = NodePath("Camera3D/RayCast3D")