From f1dea7e36dc3752a6bd0d963bdc8a666aa011ccc Mon Sep 17 00:00:00 2001 From: Clevertop Date: Sun, 11 Aug 2024 12:47:57 +1000 Subject: [PATCH] game now handles player/commands falling out of the world, updated readme with todo and removed todo.txt --- Commands/command_block.gd | 5 +++++ Commands/command_pedestal.gd | 3 +++ README.md | 33 ++++++++++++++++++++++++++++++--- Scripts/ChronoManager.gd | 28 +++++++--------------------- Scripts/Player.gd | 4 +++- TODO.txt | 11 ----------- 6 files changed, 48 insertions(+), 36 deletions(-) delete mode 100644 TODO.txt diff --git a/Commands/command_block.gd b/Commands/command_block.gd index 56dd240..cbf9b25 100644 --- a/Commands/command_block.gd +++ b/Commands/command_block.gd @@ -5,6 +5,7 @@ class_name Command_Block @export var command_name : String @export var command_sprite : Texture2D#: @export var collider : CollisionShape3D +var spawn_pos : Vector3 #set(new_texture): #if command_sprite != null: #command_sprite.changed.disconnect(on_texture_changed) @@ -15,11 +16,15 @@ class_name Command_Block func _ready(): $MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate() $MeshInstance3D.material_override.albedo_texture = command_sprite + spawn_pos = global_position pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): + if(global_position.y < -25): + global_position = spawn_pos + linear_velocity = Vector3(0,0,0) pass #func on_texture_changed(): diff --git a/Commands/command_pedestal.gd b/Commands/command_pedestal.gd index 07842ee..fa04ead 100644 --- a/Commands/command_pedestal.gd +++ b/Commands/command_pedestal.gd @@ -15,4 +15,7 @@ func _ready(): # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): + if(slot.get_child_count() == 0): + placed_command = null + has_command = false pass diff --git a/README.md b/README.md index 23e41e3..008e75c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,34 @@ # ChronoChamber -Puzzle game made for the Playmakers August Jam 2024 +Puzzle game made by Tom for the Playmakers August Jam 2024 # Credits -- Dungeon Crawl Stone Soup -- https://freesound.org/people/radian/sounds/62986/ +- Dungeon Crawl Stone Soup - all textures +- https://freesound.org/people/radian/sounds/62986/ - Command chime sound + +# TODO +- [x] FPS Controller +- [x] Chrono terminal +- [x] commands +- [ ] level deign + - aiming for at least 5 levels, ideally about 10 +- [ ] level funciton + - [x] Losing the game + - [ ] winning the game and moving to next level +- [x] command functions +- [ ] test camera controls for framerate independance +- [ ] Menu + - [ ] Level select + - [ ] Credits page +- [ ] itch.io page + + +## COMMANDS +- [x] Jump - go up! works in the air too +- [x] Dash - Move in direction you are facing for 0.3s +- [x] Phase - collider turns off for 1 second (should i make this longer or a toggle perhaps?) +- 2-3 more commands would add more content/puzzle potencial + +## BUGS +- [x] cant place command block in pedestals which ahs already had one +- [x] cammoand blocks can be lost by falling out of world diff --git a/Scripts/ChronoManager.gd b/Scripts/ChronoManager.gd index e7e659c..ae0f247 100644 --- a/Scripts/ChronoManager.gd +++ b/Scripts/ChronoManager.gd @@ -44,7 +44,7 @@ func _process(delta): start_room() if Input.is_action_just_pressed("reset"): - gui.show_lose_screen("Reset Pressed", 3) + gui.show_lose_screen("Reset Pressed", 2) fail_room() if room_started and current_tick < level_time+1: @@ -55,7 +55,7 @@ func _process(delta): tick_timer = 0 current_tick += 1 if current_tick == 11: - gui.show_lose_screen("Time Expired", 3) + gui.show_lose_screen("Time Expired", 2) player.clear_effects() fail_room() pass @@ -88,25 +88,11 @@ func _process(delta): - #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 + if (player.global_position.y < -20): + fail_room() + gui.show_lose_screen("Fell out of world", 2) + + diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 676f33d..32472ca 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -12,7 +12,7 @@ extends CharacterBody3D signal object_clicked(object : Node3D) var SPEED = 5.0 -const JUMP_VELOCITY = 4.5 +const JUMP_VELOCITY = 9 #was 4.5 #effects var dash_time = 0 @@ -105,6 +105,8 @@ func _physics_process(delta): gravity = ProjectSettings.get_setting("physics/3d/default_gravity") pass + + move_and_slide() diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index 037d301..0000000 --- a/TODO.txt +++ /dev/null @@ -1,11 +0,0 @@ -- [x] FPS Controller -- [x] Chrono terminal -- [x] commands -- [ ] level deign -- [ ] level funciton -- [x] command functions -- [ ] test camera controls for framerate independance - - -BUGS -- [ ] cant place command block in pedestals which ahs already had one