started working on room transition but its very janky, might just make it a basic resest?
This commit is contained in:
parent
52426368b1
commit
6c0bc9fbd6
6 changed files with 101 additions and 4 deletions
BIN
Assets/62986__radian__chime-0011.wav
Normal file
BIN
Assets/62986__radian__chime-0011.wav
Normal file
Binary file not shown.
24
Assets/62986__radian__chime-0011.wav.import
Normal file
24
Assets/62986__radian__chime-0011.wav.import
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://jm6vo1vxrlyx"
|
||||
path="res://.godot/imported/62986__radian__chime-0011.wav-434d408e4df2fa2541cdb8adf10ca63d.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/62986__radian__chime-0011.wav"
|
||||
dest_files=["res://.godot/imported/62986__radian__chime-0011.wav-434d408e4df2fa2541cdb8adf10ca63d.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=28 format=3 uid="uid://bojbawyoy11i4"]
|
||||
[gd_scene load_steps=29 format=3 uid="uid://bojbawyoy11i4"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/ChronoManager.gd" id="1_5b2rd"]
|
||||
[ext_resource type="Material" uid="uid://cr4ra7ijk1uec" path="res://Assets/Materials/floor.tres" id="2_0aj3l"]
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://dd150xco2ee5q" path="res://Assets/Textures/cobalt_stone_4.png" id="7_qjeey"]
|
||||
[ext_resource type="PackedScene" uid="uid://cq4rfdsc5kghr" path="res://Commands/command_pedestal.tscn" id="10_sghta"]
|
||||
[ext_resource type="Texture2D" uid="uid://vc7wwv4wgabf" path="res://Commands/jump.png" id="10_x6wpo"]
|
||||
[ext_resource type="AudioStream" uid="uid://jm6vo1vxrlyx" path="res://Assets/62986__radian__chime-0011.wav" id="12_bm4h4"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_21vdj"]
|
||||
material = ExtResource("2_0aj3l")
|
||||
|
|
@ -91,6 +92,7 @@ item/3/navigation_layers = 1
|
|||
background_mode = 1
|
||||
background_color = Color(1, 1, 1, 1)
|
||||
ambient_light_energy = 0.5
|
||||
fog_enabled = true
|
||||
fog_light_color = Color(0.403903, 7.64076e-07, 2.40654e-08, 1)
|
||||
fog_density = 0.0
|
||||
fog_sky_affect = 0.0
|
||||
|
|
@ -106,12 +108,15 @@ material = SubResource("StandardMaterial3D_itc1d")
|
|||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_y4l56"]
|
||||
|
||||
[node name="ChronoManager" type="Node3D" node_paths=PackedStringArray("gui", "pedestals")]
|
||||
[node name="ChronoManager" type="Node3D" node_paths=PackedStringArray("player", "gui", "pedestals", "chime_player", "world_env")]
|
||||
script = ExtResource("1_5b2rd")
|
||||
pedestal_off_mat = ExtResource("2_0aj3l")
|
||||
pedestal_on_mat = ExtResource("3_mnhg8")
|
||||
player = NodePath("Player")
|
||||
gui = NodePath("Gui")
|
||||
pedestals = [NodePath("Pedestals/CommandPedestal"), NodePath("Pedestals/CommandPedestal2"), NodePath("Pedestals/CommandPedestal3"), NodePath("Pedestals/CommandPedestal4"), NodePath("Pedestals/CommandPedestal5"), NodePath("Pedestals/CommandPedestal6"), NodePath("Pedestals/CommandPedestal7"), NodePath("Pedestals/CommandPedestal8"), NodePath("Pedestals/CommandPedestal9"), NodePath("Pedestals/CommandPedestal10")]
|
||||
chime_player = NodePath("AudioStreamPlayer")
|
||||
world_env = NodePath("WorldEnvironment")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_hsi55")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.12895, 0)
|
||||
|
|
@ -185,5 +190,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1, 2.5)
|
|||
[node name="CommandPedestal10" parent="Pedestals" instance=ExtResource("10_sghta")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1, 1.5)
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("12_bm4h4")
|
||||
|
||||
[connection signal="broadcast" from="." to="Player" method="_on_chrono_manager_broadcast"]
|
||||
[connection signal="object_clicked" from="Player" to="." method="_on_player_object_clicked"]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,7 @@
|
|||
# ChronoChamber
|
||||
Puzzle game made for the Playmakers August Jam 2024
|
||||
|
||||
|
||||
# Credits
|
||||
- Dungeon Crawl Stone Soup
|
||||
- https://freesound.org/people/radian/sounds/62986/
|
||||
|
|
|
|||
|
|
@ -11,10 +11,17 @@ var room_started : bool = false
|
|||
var current_tick = 0
|
||||
@export var pedestal_off_mat : Material
|
||||
@export var pedestal_on_mat : Material
|
||||
var room_failed = false
|
||||
var fail_timer = 3
|
||||
var room_ready = false
|
||||
var ready_timer = 1.5
|
||||
@export var player : CharacterBody3D
|
||||
|
||||
@export_group("Node References")
|
||||
@export var gui : Control
|
||||
@export var pedestals : Array[Pedestal]
|
||||
@export var chime_player : AudioStreamPlayer
|
||||
@export var world_env : WorldEnvironment
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
|
@ -28,10 +35,15 @@ func _process(delta):
|
|||
if Input.is_action_just_pressed("debug_start"):
|
||||
start_room()
|
||||
|
||||
if room_started and current_tick < level_time:
|
||||
if Input.is_action_just_pressed("reset"):
|
||||
fail_room()
|
||||
|
||||
if room_started and current_tick < level_time+1:
|
||||
tick_timer += delta
|
||||
|
||||
if tick_timer > level_tick:
|
||||
if current_tick == 11:
|
||||
fail_room()
|
||||
tick_timer = 0
|
||||
current_tick += 1
|
||||
print("Tick: " + str(current_tick))
|
||||
|
|
@ -42,7 +54,32 @@ func _process(delta):
|
|||
if activated_pedestal.has_command:
|
||||
print("broadcasting: " + activated_pedestal.placed_command.command_name)
|
||||
broadcast.emit(activated_pedestal.placed_command.command_name)
|
||||
|
||||
chime_player.volume_db = 0
|
||||
chime_player.pitch_scale = 1
|
||||
chime_player.play()
|
||||
else:
|
||||
chime_player.volume_db = -10
|
||||
chime_player.pitch_scale = 0.5
|
||||
chime_player.play()
|
||||
|
||||
world_env.environment.fog_enabled = room_failed #this whole section is cooked
|
||||
if room_failed:
|
||||
fail_timer -= delta
|
||||
var effect_number = 3-fail_timer
|
||||
world_env.environment.fog_density = clampf(pow(effect_number,2),0,10)
|
||||
world_env.environment.fog_sky_affect = clampf(effect_number/1,0,1)
|
||||
if fail_timer < 0:
|
||||
room_failed = false
|
||||
reset_room()
|
||||
if not room_ready:
|
||||
ready_timer -= delta
|
||||
var effect_number = ready_timer
|
||||
world_env.environment.fog_density = clampf(pow(effect_number,2),0,10)
|
||||
world_env.environment.fog_sky_affect = clampf(effect_number/1,0,1)
|
||||
|
||||
if ready_timer < 0:
|
||||
room_ready = true
|
||||
player.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
pass
|
||||
|
||||
|
||||
|
|
@ -57,7 +94,25 @@ func start_room():
|
|||
#hide crosshair
|
||||
pass
|
||||
|
||||
func fail_room():
|
||||
print("ROOM FAILED")
|
||||
room_failed = true
|
||||
player.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
# close exit, freeze player?
|
||||
pass
|
||||
|
||||
func reset_room():
|
||||
print("RESETTING ROOM")
|
||||
room_started = false
|
||||
room_failed = false
|
||||
fail_timer = 3
|
||||
room_ready = false
|
||||
ready_timer = 1.5
|
||||
tick_timer = 0
|
||||
current_tick = 0
|
||||
for i in pedestals.size():
|
||||
var activated_pedestal = pedestals[i]
|
||||
activated_pedestal.mesh.mesh.material = pedestal_off_mat
|
||||
# run if timer expires, resets puzzle
|
||||
# replace door
|
||||
# put player back in start room
|
||||
|
|
|
|||
|
|
@ -63,6 +63,11 @@ debug_start={
|
|||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
reset={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue