diff options
author | Tyler Murphy <tylerm@tylerm.dev> | 2023-06-25 18:19:26 -0400 |
---|---|---|
committer | Tyler Murphy <tylerm@tylerm.dev> | 2023-06-25 18:19:26 -0400 |
commit | 0281233cbdc76e065a812780de0325fcfbd4e660 (patch) | |
tree | 51b8049b98de607fbb84ded183787a3958fc93f3 /client/src/types.ts | |
parent | export and load maps (diff) | |
download | tuxman-0281233cbdc76e065a812780de0325fcfbd4e660.tar.gz tuxman-0281233cbdc76e065a812780de0325fcfbd4e660.tar.bz2 tuxman-0281233cbdc76e065a812780de0325fcfbd4e660.zip |
ghost
Diffstat (limited to 'client/src/types.ts')
-rw-r--r-- | client/src/types.ts | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/client/src/types.ts b/client/src/types.ts index c130980..76f5116 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -1,5 +1,6 @@ export const ATLAS_TILE_WIDTH = 32 +export const GAME_MAP_COUNT = 4 export enum Tile { EMPTY = 0, @@ -49,6 +50,28 @@ export enum Key { RIGHT } +export enum GhostType { + BLINKY = 0, + PINKY = 1, + INKY = 2, + CLYDE = 3 +} + +export enum GhostState { + CHASE, + SCATTER, + EATEN, + SCARED +} + +export type Ghost = { + pos: Vec2, + type: GhostType, + target: Vec2, + state: GhostState, + currentDirection: Rotation, +} + export type KeyMap = { [key: string]: Key } @@ -123,23 +146,37 @@ export type Items = { [key: number]: Item } +export enum SpawnIndex { + PAC_SPAWN_1 = 1, + PAC_SPAWN_2 = 2, + PAC_SPAWN_3 = 3, + PAC_SPAWN_4 = 4, + GHOST_SPAWN = 0 +} + export type Map = { data: number[], walls: number[], width: number, height: number, - id: number + id: number, + spawns?: Vec2[] } export type Maps = { [key: number]: Map } +export type Ghosts = [Ghost, Ghost, Ghost, Ghost] + export type GameState = { started: boolean, input: InputMap, players: Players, + ghosts: Ghosts, items: Items, + frame: number, + rng: number, mapId: number | undefined } |