Increment score within floor
This commit is contained in:
parent
8717b4704a
commit
21f925412e
1 changed files with 4 additions and 5 deletions
|
|
@ -220,6 +220,10 @@ func _on_pulse_blocked():
|
|||
survivors_remaining -= 1
|
||||
people_in_elevator += 1
|
||||
EventBus.people_changed.emit(people_in_elevator, THRESHOLD)
|
||||
score += POINTS_PER_PERSON
|
||||
if people_in_elevator > THRESHOLD:
|
||||
score += POINTS_PER_PERSON
|
||||
EventBus.score_changed.emit(score)
|
||||
if $SfxBlock.stream:
|
||||
$SfxBlock.play()
|
||||
|
||||
|
|
@ -256,12 +260,7 @@ func _on_doors_closing(fast: bool = false):
|
|||
EventBus.game_lost.emit(Strings.LOSS_TOO_FEW)
|
||||
return
|
||||
|
||||
var base_points = people_in_elevator * POINTS_PER_PERSON
|
||||
var bonus = max(0, people_in_elevator - THRESHOLD) * POINTS_PER_PERSON
|
||||
score += base_points + bonus
|
||||
saved_count += people_in_elevator
|
||||
|
||||
EventBus.score_changed.emit(score)
|
||||
EventBus.saved_changed.emit(saved_count)
|
||||
|
||||
current_floor -= 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue