-
Notifications
You must be signed in to change notification settings - Fork 2
Places
Kevin edited this page Apr 10, 2020
·
1 revision
A place is a specific map cell's interface. By map cell I mean a group of tiles that make up 1 screen's worth of area. An example of a 'place' is the image below:
A Place can contain the following fields defined in this interface:
export interface Place {
scene: ex.Scene;
name: string;
type: EventTypeType;
entryX?: number;
entryY?: number;
eventTiles?: EventTiles;
posAtEnter?: ex.Vector;
posAtExit?: ex.Vector;
placeData?: any;
music?: any;
}
The required fields of a place are as follows:
scene: ex.Scene;
name: string;
type: EventTypeType;
A scene can be found in the excaliburJS documentation All places need a name, this helps with identification. All places will have a type, This type will be defined in an Enum as follows:
export enum EventTypeType {
Warp = "warp", // Warp to another map
Edge = "edge", // Warp to another map that is directly adjacent to your current map
Back = "back", // Revert place state to where you were before you entered the current map
}
These types can be set in the application tiled in this way:
The resulting JSON will look something like this:
[
{"entry_x": 80},
{"entry_y": 144},
{"64,144": {"type":"warp", "scene": "1,1"}},
{"80,144": {"type":"warp", "scene": "1,1"}}
]