Make display public
This commit is contained in:
parent
90bac08e0b
commit
32927d5623
|
|
@ -6,6 +6,25 @@ export class Position extends Component<{ x: number, y: number, z: number }> {
|
|||
constructor(x = 0, y = 0, z = 0) {
|
||||
super({ x, y, z });
|
||||
}
|
||||
|
||||
get x() {
|
||||
return this.state.x;
|
||||
}
|
||||
get y() {
|
||||
return this.state.y;
|
||||
}
|
||||
get z() {
|
||||
return this.state.z;
|
||||
}
|
||||
set x(x: number) {
|
||||
this.state.x = x;
|
||||
}
|
||||
set y(y: number) {
|
||||
this.state.y = y;
|
||||
}
|
||||
set z(z: number) {
|
||||
this.state.z = z;
|
||||
}
|
||||
}
|
||||
|
||||
export const getPosition = (entity?: Entity, key?: string) => entity?.get(Position, key)?.state;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { System, World } from "@common/rpg/core/world";
|
|||
import { Resources } from "@common/rpg/utils/resources";
|
||||
|
||||
export class TextDisplaySystem extends System {
|
||||
private readonly display: TextDisplay;
|
||||
public readonly display: TextDisplay;
|
||||
|
||||
constructor(display?: TextDisplay) {
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import './assets/style.css';
|
|||
import { Direction, getOppositeDirection, MAP_HEIGHT, MAP_WIDTH, MAP_X, MAP_Y, ROOM_AREA_HEIGHT, ROOM_AREA_WIDTH, ROOM_AREA_X, ROOM_AREA_Y } from './const';
|
||||
import { getPossibleRoomsCount, getRoom, getRoomsCount, getRoomsForLayer, getMapRoomChar, Room, Door } from './room';
|
||||
import { createPlayer, Player } from './player';
|
||||
import { resolveActions, resolveVariables } from '@common/rpg/utils/variables';
|
||||
import { createItems } from './item';
|
||||
|
||||
|
||||
export default async function main() {
|
||||
|
|
@ -168,6 +170,8 @@ export default async function main() {
|
|||
}
|
||||
}
|
||||
|
||||
createItems(world);
|
||||
|
||||
while (true) {
|
||||
const dt = await nextFrame();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue