This commit is contained in:
k8w 2021-12-03 17:08:12 +08:00
parent 171c0264a2
commit ca0f89a1b8
2 changed files with 13 additions and 1 deletions

View File

@ -3,9 +3,13 @@ import { ArrowState } from "./state/ArrowState";
import { PlayerState } from "./state/PlayerState";
export interface GameSystemState {
// 当前的时间(游戏时间)
now: number,
// 玩家
players: PlayerState[],
// 飞行中的箭矢
arrows: ArrowState[],
// 箭矢的 ID 生成
nextArrowId: number
}
@ -119,4 +123,9 @@ export interface TimePast {
type: 'TimePast',
dt: number
}
export type GameSystemInput = PlayerMove | PlayerAttack | PlayerJoin | PlayerLeave | TimePast;
export type GameSystemInput = PlayerMove
| PlayerAttack
| PlayerJoin
| PlayerLeave
| TimePast;

View File

@ -1,6 +1,9 @@
export type ArrowState = {
id: number,
// 谁发出的箭
fromPlayerId: number,
// 落地时间(游戏时间)
targetTime: number,
// 落点位置(游戏位置)
targetPos: { x: number, y: number }
}