From f2b176c978c80dee71e2e640451aa7b607238400 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Sun, 10 May 2026 15:20:48 +0100 Subject: [PATCH] Cleanup dead references; update gitignore --- .gitignore | 3 +- scenes/elevator_panel.gd | 65 +++++----------------------------------- scenes/node_3d.gd | 43 -------------------------- scenes/node_3d.gd.uid | 1 - 4 files changed, 10 insertions(+), 102 deletions(-) delete mode 100644 scenes/node_3d.gd delete mode 100644 scenes/node_3d.gd.uid diff --git a/.gitignore b/.gitignore index 5a5da54..2e25732 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .godot/ /android/ /.DS_Store -jennie-docs \ No newline at end of file +/*.md +/jennie-notes/ diff --git a/scenes/elevator_panel.gd b/scenes/elevator_panel.gd index aaf694c..f22187a 100644 --- a/scenes/elevator_panel.gd +++ b/scenes/elevator_panel.gd @@ -19,20 +19,6 @@ var points_per_person := 100 # base + bonus per person above threshold var people_in_elevator := 0 -# PLACEHOLDER: replaced by Henry's robot collision signal. -# Handler is _on_timer_expired(). -var floor_time_limit := 10.0 - -# PLACEHOLDER: remove when Henry's spawning system is in. -@onready var spawner = get_node("../../Node3D") - -signal floor_changed(floor_num: int) -signal saved_changed(count: int) -signal score_changed(new_score: int) -signal people_changed(count: int, threshold_val: int) -signal game_won -signal game_lost - func _ready(): var button = $PanelMargin/PanelColumn/CloseButton button.text = "BLOCK" @@ -59,29 +45,13 @@ func _start_floor(): var floors_remaining = current_floor - 1 survivors_remaining = base_survivors + (floors_remaining * survivors_per_floor_increase) - people_changed.emit(people_in_elevator, threshold) - floor_changed.emit(current_floor) - - # Spawn 3D survivors (placeholder) - print("spawner: ", spawner, " survivors: ", survivors_remaining) - if spawner: - spawner.start_spawning(survivors_remaining) + EventBus.people_changed.emit(people_in_elevator, threshold) + EventBus.floor_changed.emit(current_floor) var screen = $PanelMargin/PanelColumn/Screen screen.start() screen.launch_pulse() # first survivor arrives - # Floor timer (placeholder for robot collision) - if has_node("FloorTimer"): - $FloorTimer.queue_free() - var timer = Timer.new() - timer.name = "FloorTimer" - timer.wait_time = floor_time_limit - timer.one_shot = true - timer.timeout.connect(_on_timer_expired) - add_child(timer) - timer.start() - # --- Input --- func _on_block_pressed(): @@ -95,7 +65,7 @@ func _on_pulse_blocked(): # This survivor made it in survivors_remaining -= 1 people_in_elevator += 1 - people_changed.emit(people_in_elevator, threshold) + EventBus.people_changed.emit(people_in_elevator, threshold) if survivors_remaining <= 0: # Everyone's in, close doors (auto-success) @@ -117,19 +87,12 @@ func _on_doors_closing(): return doors_closing_flag = true - # Stop spawning (placeholder) - if spawner: - spawner.stop_spawning() - - if has_node("FloorTimer"): - $FloorTimer.stop() - var screen = $PanelMargin/PanelColumn/Screen # Lose: not enough people if people_in_elevator < threshold: screen.show_loss("TOO FEW") - game_lost.emit() + EventBus.game_lost.emit() return # Score this floor @@ -138,16 +101,16 @@ func _on_doors_closing(): score += base_points + bonus saved_count += people_in_elevator - score_changed.emit(score) - saved_changed.emit(saved_count) + EventBus.score_changed.emit(score) + EventBus.saved_changed.emit(saved_count) current_floor -= 1 # Win: reached ground floor if current_floor <= 1: screen.show_win() - floor_changed.emit(current_floor) - game_won.emit() + EventBus.floor_changed.emit(current_floor) + EventBus.game_won.emit() return # Next floor after countdown @@ -157,15 +120,3 @@ func _on_doors_closing(): var tween = create_tween() tween.tween_interval(2.0) tween.tween_callback(_start_floor) - -# --- Timer (placeholder for robot collision) --- - -func _on_timer_expired(): - if doors_closing_flag: - return - doors_closing_flag = true - # Stop spawning (placeholder) - if spawner: - spawner.stop_spawning() - $PanelMargin/PanelColumn/Screen.show_loss("TOO LATE") - game_lost.emit() diff --git a/scenes/node_3d.gd b/scenes/node_3d.gd deleted file mode 100644 index 839b941..0000000 --- a/scenes/node_3d.gd +++ /dev/null @@ -1,43 +0,0 @@ -extends Node3D - -@export var spawn_position := Vector3(0, 0, -20) -@export var spawn_spread := 2.0 -@export var spawn_interval := 1.5 - -var survivor_scene := preload("res://scenes/survivor.tscn") -var survivors_to_spawn := 0 -var spawn_timer: Timer - -func start_spawning(count: int): - survivors_to_spawn = count - if not spawn_timer: - spawn_timer = Timer.new() - spawn_timer.one_shot = false - spawn_timer.wait_time = spawn_interval - spawn_timer.timeout.connect(_spawn_one) - add_child(spawn_timer) - spawn_timer.start() - _spawn_one() # first one immediately - -func stop_spawning(): - if spawn_timer: - spawn_timer.stop() - survivors_to_spawn = 0 - -func _spawn_one(): - if survivors_to_spawn <= 0: - if spawn_timer: - spawn_timer.stop() - return - - var survivor = survivor_scene.instantiate() - var offset_x = randf_range(-spawn_spread, spawn_spread) - var xform = Transform3D() - xform.origin = spawn_position + Vector3(offset_x, 0, 0) - survivors_to_spawn -= 1 - _deferred_add.call_deferred(survivor, xform) - -func _deferred_add(survivor, xform): - get_tree().current_scene.add_child(survivor) - survivor.owner = get_tree().current_scene - survivor.start(xform) diff --git a/scenes/node_3d.gd.uid b/scenes/node_3d.gd.uid deleted file mode 100644 index 61526f8..0000000 --- a/scenes/node_3d.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://co8y4knanokeg