This commit is contained in:
wfz
2026-04-15 20:58:16 +08:00
commit 8ab9a9fa70
33 changed files with 6140 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
export const GRID_SIZE = 32
export const CELL_SIZE = 1
export const PLAYER_SIZE = 0.8
export const ZOMBIE_SIZE = 0.8
export const WALL_SIZE = 1
export const SPAWN_SIZE = 1
export const TICK_RATE = 30
export const TICK_INTERVAL = 1000 / TICK_RATE
export const WEAPONS = {
PISTOL: 'pistol',
MACHINE_GUN: 'machine_gun',
SHOTGUN: 'shotgun',
GRENADE: 'grenade'
}
export const WEAPON_CONFIG = {
[WEAPONS.PISTOL]: {
name: 'Pistol',
damage: 25,
fireRate: 400,
ammo: Infinity,
maxAmmo: Infinity,
speed: 20,
spread: 0,
pellets: 1,
range: 30,
auto: false,
chargeable: false
},
[WEAPONS.MACHINE_GUN]: {
name: 'Machine Gun',
damage: 15,
fireRate: 100,
ammo: 100,
maxAmmo: 100,
speed: 25,
spread: 0.05,
pellets: 1,
range: 25,
auto: true,
chargeable: false
},
[WEAPONS.SHOTGUN]: {
name: 'Shotgun',
damage: 20,
fireRate: 800,
ammo: 20,
maxAmmo: 20,
speed: 18,
spread: 0.15,
pellets: 6,
range: 12,
auto: false,
chargeable: false
},
[WEAPONS.GRENADE]: {
name: 'Grenade',
damage: 100,
fireRate: 1500,
ammo: 10,
maxAmmo: 10,
speed: 12,
spread: 0,
pellets: 1,
range: 15,
auto: false,
chargeable: true,
maxCharge: 2000,
explosionRadius: 3
}
}
export const ZOMBIE_CONFIG = {
BASE_HEALTH: 100,
BASE_SPEED: 2,
DAMAGE: 10,
ATTACK_RATE: 1000,
SPAWN_INTERVAL_BASE: 3000,
SPAWN_INTERVAL_MIN: 800,
DIFFICULTY_INCREASE_INTERVAL: 30000,
HEALTH_INCREASE_PER_WAVE: 20,
SPEED_INCREASE_PER_WAVE: 0.1,
LOOT_DROP_CHANCE: 0.3
}
export const PLAYER_CONFIG = {
MAX_HEALTH: 100,
SPEED: 5,
INVULNERABLE_TIME: 500
}
export const MSG_TYPE = {
CREATE_ROOM: 'create_room',
JOIN_ROOM: 'join_room',
LEAVE_ROOM: 'leave_room',
ROOM_LIST: 'room_list',
ROOM_STATE: 'room_state',
READY: 'ready',
START_GAME: 'start_game',
GAME_STARTED: 'game_started',
PLAYER_INPUT: 'player_input',
GAME_STATE: 'game_state',
PLAYER_JOIN: 'player_join',
PLAYER_LEAVE: 'player_leave',
ERROR: 'error',
PING: 'ping',
PONG: 'pong'
}