Hook up robot + perfect-block stun + moving block zone!
This commit is contained in:
parent
1d6b5c35ca
commit
9dd2546613
6 changed files with 95 additions and 14 deletions
|
|
@ -18,8 +18,15 @@ var threshold := 2
|
|||
var score := 0
|
||||
var points_per_person := 100 # base + bonus per person above threshold
|
||||
|
||||
# Moving block zone (starts at floor 7, faster as we descend)
|
||||
const MOVING_ZONE_START_FLOOR := 7
|
||||
const MOVING_ZONE_BASE_SPEED := 40.0
|
||||
const MOVING_ZONE_SPEED_PER_FLOOR := 12.0
|
||||
|
||||
var people_in_elevator := 0
|
||||
|
||||
const PERFECT_STUN_DURATION := 0.25
|
||||
|
||||
func _ready():
|
||||
var button = $PanelMargin/PanelColumn/CloseButton
|
||||
button.text = "BLOCK"
|
||||
|
|
@ -27,6 +34,7 @@ func _ready():
|
|||
|
||||
var screen = $PanelMargin/PanelColumn/Screen
|
||||
screen.pulse_blocked.connect(_on_pulse_blocked)
|
||||
screen.pulse_blocked_perfect.connect(_on_pulse_blocked_perfect)
|
||||
screen.doors_closing.connect(_on_doors_closing)
|
||||
|
||||
EventBus.game_started.connect(_start_floor)
|
||||
|
|
@ -44,6 +52,7 @@ func _start_floor():
|
|||
$SfxOpen.play()
|
||||
doors_closing_flag = false
|
||||
people_in_elevator = 0
|
||||
EventBus.doors_opened.emit()
|
||||
|
||||
# More survivors on higher floors, fewer near the ground
|
||||
var floors_remaining = current_floor - 1
|
||||
|
|
@ -56,6 +65,10 @@ func _start_floor():
|
|||
var screen = $PanelMargin/PanelColumn/Screen
|
||||
screen.start()
|
||||
|
||||
if current_floor <= MOVING_ZONE_START_FLOOR:
|
||||
var floors_below = MOVING_ZONE_START_FLOOR - current_floor
|
||||
screen.set_block_zone_movement(MOVING_ZONE_BASE_SPEED + floors_below * MOVING_ZONE_SPEED_PER_FLOOR)
|
||||
|
||||
if not _onboarded:
|
||||
_onboarded = true
|
||||
screen.show_onboarding("BLOCK\nIN GREEN ZONE")
|
||||
|
|
@ -77,6 +90,9 @@ func _on_block_pressed():
|
|||
|
||||
# --- Pulse callbacks ---
|
||||
|
||||
func _on_pulse_blocked_perfect():
|
||||
EventBus.robot_stun_requested.emit(PERFECT_STUN_DURATION)
|
||||
|
||||
func _on_pulse_blocked():
|
||||
# This survivor made it in
|
||||
survivors_remaining -= 1
|
||||
|
|
@ -104,13 +120,14 @@ func _on_doors_closing():
|
|||
if doors_closing_flag:
|
||||
return
|
||||
doors_closing_flag = true
|
||||
EventBus.doors_closed.emit()
|
||||
|
||||
var screen = $PanelMargin/PanelColumn/Screen
|
||||
|
||||
# Lose: not enough people
|
||||
if people_in_elevator < threshold:
|
||||
screen.show_loss("TOO FEW")
|
||||
EventBus.game_lost.emit()
|
||||
EventBus.game_lost.emit("TOO FEW")
|
||||
return
|
||||
|
||||
# Score this floor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue