summaryrefslogtreecommitdiff
path: root/client/src/types.ts
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-06-25 18:19:26 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-06-25 18:19:26 -0400
commit0281233cbdc76e065a812780de0325fcfbd4e660 (patch)
tree51b8049b98de607fbb84ded183787a3958fc93f3 /client/src/types.ts
parentexport and load maps (diff)
downloadtuxman-0281233cbdc76e065a812780de0325fcfbd4e660.tar.gz
tuxman-0281233cbdc76e065a812780de0325fcfbd4e660.tar.bz2
tuxman-0281233cbdc76e065a812780de0325fcfbd4e660.zip
ghost
Diffstat (limited to 'client/src/types.ts')
-rw-r--r--client/src/types.ts39
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
}