Accelerate time when all entities are dead
This commit is contained in:
parent
5f607aa6d5
commit
8c075b25b0
|
@ -350,6 +350,14 @@ export function GameState(ctx: ContextI, selectedAnimal: string, selectedSegment
|
|||
updateGameOver()
|
||||
}
|
||||
} else {
|
||||
// If it's just the player at night, accelerate time.
|
||||
if (entities.filter(v=>v instanceof AnimalEntity).length === 1) {
|
||||
if (isNight) {
|
||||
modeTimer += realDelta * 4
|
||||
} else {
|
||||
modeTimer += realDelta
|
||||
}
|
||||
}
|
||||
// Update clock
|
||||
{
|
||||
//clockContainer.width = ctx.app.renderer.width
|
||||
|
@ -689,6 +697,8 @@ export function GameState(ctx: ContextI, selectedAnimal: string, selectedSegment
|
|||
}
|
||||
}
|
||||
|
||||
nightTime = (30+daysSurvived) * 1000
|
||||
dayTime = (30-daysSurvived) * 1000
|
||||
}
|
||||
|
||||
nightfall(false)
|
||||
|
|
Loading…
Reference in New Issue
Block a user