Files
nissefolk/src/config.ts

51 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-03-20 08:11:31 +00:00
import type { CropKind, ItemId, BuildingType } from './types'
export const TILE_SIZE = 32
export const CHUNK_SIZE = 16
export const WORLD_CHUNKS = 32
export const WORLD_TILES = WORLD_CHUNKS * CHUNK_SIZE
export const WORLD_PX = WORLD_TILES * TILE_SIZE
export const PLAYER_SPEED = 180
export const INTERACTION_RANGE = 60
export const CAMERA_LERP = 0.09
export const TREE_HEALTH = 3
export const ROCK_HEALTH = 5
export const BUILDING_COSTS: Record<BuildingType, Record<string, number>> = {
floor: { wood: 2 },
wall: { wood: 3, stone: 1 },
chest: { wood: 5, stone: 2 },
bed: { wood: 6 },
stockpile_zone:{ wood: 0 },
}
export interface CropConfig {
stages: number
stageTimeMs: number
rewards: Partial<Record<ItemId, number>>
}
export const CROP_CONFIGS: Record<CropKind, CropConfig> = {
wheat: { stages: 3, stageTimeMs: 20_000, rewards: { wheat: 3, wheat_seed: 2 } },
carrot: { stages: 3, stageTimeMs: 25_000, rewards: { carrot: 4, carrot_seed: 1 } },
}
// Villager config
export const VILLAGER_SPEED = 75 // px/s — slow and visible
export const VILLAGER_SPAWN_INTERVAL = 8_000 // ms between spawn checks
export const VILLAGER_WORK_TIMES: Record<string, number> = {
chop: 3000,
mine: 5000,
farm: 1200,
}
export const VILLAGER_NAMES = [
'Aldric','Brix','Cora','Dwyn','Edna','Finn','Greta',
'Holt','Iris','Jorn','Kira','Lars','Mira','Nox',
'Orla','Pike','Quinn','Rook','Sera','Tull','Uma','Vex',
]
export const SAVE_KEY = 'tg_save_v4'
export const AUTOSAVE_INTERVAL = 30_000