Interface: GlobalEvents
game/events.GlobalEvents
All types of events able to be sent or emitted from the global event bus.
Properties
addLayer
• addLayer: (layer
: GenericLayer
, saveData
: Record
<string
, unknown
>) => void
Type declaration
▸ (layer
, saveData
): void
Sent whenever a layer is added.
Parameters
Name | Type | Description |
---|---|---|
layer | GenericLayer | The layer being added. |
saveData | Record <string , unknown > | The layer's save data object within player. |
Returns
void
Defined in
profectus/src/game/events.ts:19
gameWon
• gameWon: VoidFunction
Sent when the game has ended.
Defined in
profectus/src/game/events.ts:41
loadSettings
• loadSettings: (settings
: Partial
<Settings
>) => void
Type declaration
▸ (settings
): void
Sent when constructing the Settings object. Use it to add default values for custom properties to the object.
See
features/features.setDefault for setting default values.
Parameters
Name | Type | Description |
---|---|---|
settings | Partial <Settings > | The settings object being constructed. |
Returns
void
Defined in
profectus/src/game/events.ts:37
removeLayer
• removeLayer: (layer
: GenericLayer
) => void
Type declaration
▸ (layer
): void
Sent whenever a layer is removed.
Parameters
Name | Type | Description |
---|---|---|
layer | GenericLayer | The layer being removed. |
Returns
void
Defined in
profectus/src/game/events.ts:24
reset
• reset: (reset
: GenericReset
) => void
Type declaration
▸ (reset
): void
Parameters
Name | Type |
---|---|
reset | GenericReset |
Returns
void
Defined in
profectus/src/features/reset.ts:95
setupVue
• setupVue: (vue
: App
<any
>) => void
Type declaration
▸ (vue
): void
Sent when setting up the Vue Application instance. Use it to register global components or otherwise set up things that should affect Vue globally.
Parameters
Name | Type | Description |
---|---|---|
vue | App <any > | The Vue App being constructed. |
Returns
void
Defined in
profectus/src/game/events.ts:47
update
• update: (diff
: number
, trueDiff
: number
) => void
Type declaration
▸ (diff
, trueDiff
): void
Sent every game tick. Runs the life cycle of the project.
Parameters
Name | Type | Description |
---|---|---|
diff | number | The delta time since last tick, in ms. |
trueDiff | number | The delta time since last tick, in ms. Unaffected by time modifiers like game/player.Player.devSpeed or game/player.Player.offlineTime. Intended for things like updating animations. |
Returns
void