Cleanup dead references; update gitignore
This commit is contained in:
parent
0bf60b7363
commit
f2b176c978
4 changed files with 10 additions and 102 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue