Accelerate time when all entities are dead

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-30 16:09:05 -08:00
parent 5f607aa6d5
commit 8c075b25b0

View File

@ -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)