GameLoop:
Filter:
GameLoop/Classes (extension) | Class

GameLoop
ExtensionExtension

The interface class of the GameLoop library

Description

GameLoop allows for easy use of the GameLoop library as it manages the creation and setup of the basic individual components. It includes a basic GUI for common operations, monitoring and visualisation.

Class Methods

.instance

Returns the GameLoop instance. GameLoop is a singleton (can have only one instance).

.new

Create a new world with the given dimensions. These arguments are used for the creation of an instance of SpatialHashing.

Arguments:

sceneWidth

in meters

sceneHeight

in meters

cellSize

in meters

Instance Methods

.guiClose

Close the GUI.

.clear

Clear and close everything.

.makeEdgeWalls

Add four wall at the edge of the space.

.switchSpace

Change the space size and cell size.

.resetCamera

Smoothly return the camera to the center of the space.

.center

Get the center of the space.

.entManager

Get the EntityManager instance used.

.fastResetCamera

Snap the camera to the center of the space.

.edgeWalls

Make edge walls.

.clearEntities

Clear all entities.

.removeCamera

The camera will only be removed when this method is called.

.repManager

Get the RepresentationManager.

.play

Start the game loop. Set the world into motion.

Arguments:

rate

The 'frame rate' of the game loop. Usually leave it as the default 0.05.

.stop

Stop the game loop.

.clearEdgeWalls

Remove the edge walls.

.clearWalls

Clear all walls.

.gui

Create the GUI and visualiser.