Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Main

Main scene of the game.

Hierarchy

  • Scene
    • Main

Index

Constructors

constructor

Properties

add

add: GameObjectFactory

A scene level Game Object Factory. This property will only be available if defined in the Scene Injection Map.

Private aiModeState

aiModeState: AIModeState

Holds the current state of the game, if the human mode is disabled. That means if the genetic algorithm controls the game.

note

Only relevant if human mode is disabled.

anims

anims: AnimationManager

A reference to the global Animation Manager. This property will only be available if defined in the Scene Injection Map.

cache

cache: CacheManager

A reference to the global Cache. This property will only be available if defined in the Scene Injection Map.

cameras

cameras: CameraManager

A scene level Camera System. This property will only be available if defined in the Scene Injection Map.

children

children: DisplayList

A scene level Game Object Display List. This property will only be available if defined in the Scene Injection Map.

data

data: DataManager

A scene level Data Manager Plugin. This property will only be available if defined in the Scene Injection Map and the plugin is installed.

events

events: EventEmitter

A scene level Event Emitter. This property will only be available if defined in the Scene Injection Map.

facebook

facebook: FacebookInstantGamesPlugin

A scene level Facebook Instant Games Plugin. This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.

game

game: Game

A reference to the Phaser.Game instance. This property will only be available if defined in the Scene Injection Map.

Private goal

goal: Goal

Reference to the goal.

note

Only referenced if human mode is enabled.

Private graphics

graphics: Graphics

Reference to the added graphics object for drawing the line between the starting point of the marble and the mouse position during the initialization phase of the marble.

Private humanModeState

humanModeState: HumanModeState

Holds the current state of the game, if the human mode is enabled.

note

Only relevant if human mode is enabled.

Private initializeConfig

initializeConfig: boolean

Specifies whether the configuration should be initialized (i. e. read from the disk) or not.

input

input: InputPlugin

A scene level Input Manager Plugin. This property will only be available if defined in the Scene Injection Map and the plugin is installed.

Private levelNumber

levelNumber: number

Holds the current level number.

lights

lights: LightsManager

A scene level Lights Manager Plugin. This property will only be available if defined in the Scene Injection Map and the plugin is installed.

load

load: LoaderPlugin

A scene level Loader Plugin. This property will only be available if defined in the Scene Injection Map and the plugin is installed.

make

make: GameObjectCreator

A scene level Game Object Creator. This property will only be available if defined in the Scene Injection Map.

Private marble

marble: Marble

Reference to the marble.

note

Only referenced if human mode is enabled.

matter

matter: MatterPhysics

A scene level Matter Physics Plugin. This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.

physics

physics: ArcadePhysics

A scene level Arcade Physics Plugin. This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.

plugins

plugins: PluginManager

A reference to the Plugin Manager.

The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install those plugins into Scenes as required.

registry

registry: DataManager

A reference to the game level Data Manager. This property will only be available if defined in the Scene Injection Map.

scale

scale: ScaleManager

A reference to the global Scale Manager. This property will only be available if defined in the Scene Injection Map.

scene

scene: ScenePlugin

A reference to the Scene Manager Plugin. This property will only be available if defined in the Scene Injection Map.

sound

sound: BaseSoundManager

A reference to the Sound Manager. This property will only be available if defined in the Scene Injection Map and the plugin is installed.

sys

sys: Systems

The Scene Systems. You must never overwrite this property, or all hell will break lose.

Private text

text: Text

Reference to the added text object for displaying the current power during the initialization phase of the marble.

textures

textures: TextureManager

A reference to the Texture Manager. This property will only be available if defined in the Scene Injection Map.

time

time: Clock

A scene level Time and Clock Plugin. This property will only be available if defined in the Scene Injection Map and the plugin is installed.

tweens

tweens: TweenManager

A scene level Tween Manager Plugin. This property will only be available if defined in the Scene Injection Map and the plugin is installed.

Phaser Methods

create

  • create(): void
  • Method called once the scene gets created. Initializes the required properties in order to start a new game.

    note

    The create() method gets called after init().

    Returns void

init

  • init(__namedParameters: { initializeConfig: boolean; levelNumber: number }): void
  • Init method for initializing the scene.

    note

    The init() method gets called after preload() but before create().

    Parameters

    • __namedParameters: { initializeConfig: boolean; levelNumber: number }
      • initializeConfig: boolean
      • levelNumber: number

    Returns void

preload

  • preload(): void
  • Loads the needed assets, currently only image files and the configuration, before the game loads to ensure the assets are ready once the game launches.

    note

    The preload() method gets called before the init() method.

    Returns void

update

  • update(): void
  • Method for updating the screen. Gets called FPS-times per second.

    Returns void

Scene utils Methods

Private createLevel

  • createLevel(levelNumber?: number): void
  • Creates the level.

    Parameters

    • Default value levelNumber: number = 0

      The number of the level. The level must exist and be specified in the configuration.

    Returns void

Private initializeHandlers

  • initializeHandlers(): void
  • Initializes all handler functions.

    Returns void

Private initializeText

  • initializeText(): void
  • Initializes the texts and graphics. Only needed if humanMode = true.

    Returns void

Generated using TypeDoc