Move the amount of culture to reach to win into a constant.

This commit is contained in:
Adrian 2024-11-05 12:44:24 +01:00
parent 3587196bd9
commit f427f4e2b6
2 changed files with 5 additions and 3 deletions

1
src/constants.ts Normal file
View File

@ -0,0 +1 @@
export const CULTURE_TO_WIN = 20000;

View File

@ -1,8 +1,9 @@
import { produce } from 'immer';
import { getBuilding, getProduction, getStorage, getUnitSource, shuffle } from './utils';
import village, { type VillageState } from "./village";
import { CULTURE_TO_WIN } from './constants';
import type { ProductionType } from './types';
import { getProduction, getStorage, shuffle } from './utils';
import village, { type VillageState } from "./village";
let lastFrame: number;
@ -84,7 +85,7 @@ export default function update(timestamp: number) {
});
// Check if the game is won.
if (V.resources.culture >= 2000) {
if (V.resources.culture >= CULTURE_TO_WIN) {
V.victory = true;
}