Skip to content

Commit

Permalink
unified jumpers, wheels and boxes into MapEntities
Browse files Browse the repository at this point in the history
  • Loading branch information
lazygyu committed Nov 22, 2024
1 parent 2dd9c48 commit 10da519
Show file tree
Hide file tree
Showing 8 changed files with 1,935 additions and 904 deletions.
39 changes: 21 additions & 18 deletions src/IPhysics.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
import type {StageDef} from './data/maps';
import type {WheelState} from './types/WheelState';
import type {BoxState} from './types/BoxState';
import type {JumperState} from './types/JumperState';
import type { StageDef } from './data/maps';
import type { WheelState } from './types/WheelState';
import type { BoxState } from './types/BoxState';
import type { JumperState } from './types/JumperState';
import { MapEntityState } from './types/MapEntity.type';

export interface IPhysics {
init(): Promise<void>;
init(): Promise<void>;

clear(): void;
clear(): void;

clearMarbles(): void;
clearMarbles(): void;

createStage(stage: StageDef): void;
createStage(stage: StageDef): void;

createMarble(id: number, x: number, y: number): void;
createMarble(id: number, x: number, y: number): void;

shakeMarble(id: number): void;
shakeMarble(id: number): void;

removeMarble(id: number): void;
removeMarble(id: number): void;

getMarblePosition(id: number): { x: any; y: any };
getMarblePosition(id: number): { x: number; y: number };

getWheels(): WheelState[];
getWheels(): WheelState[];

getBoxes(): BoxState[];
getBoxes(): BoxState[];

getJumpers(): JumperState[];
getJumpers(): JumperState[];

impact(id: number): void;
getEntities(): MapEntityState[];

start(): void;
impact(id: number): void;

step(deltaSeconds: number): void;
start(): void;

step(deltaSeconds: number): void;
}
5 changes: 5 additions & 0 deletions src/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ export enum Skills {
None,
Impact,
}

export const DefaultEntityColor = {
box: 'cyan',
circle: 'yellow',
} as const;
Loading

0 comments on commit 10da519

Please sign in to comment.