Class: GameObjectSet

GameObjectSet()

Utility class for a collection of GameObjects

Found in Chapter 6, page 272 in the textbook

Example: 6.1 Game Objects

Constructor

new GameObjectSet()

Source:

Methods

addToSet(obj)

Adds an GameObject to this GameObjectSet
Parameters:
Name Type Description
obj GameObject GameObject to add to the set
Source:

draw(aCamera)

Calls draw on each GameObject in this GameObjectSet
Parameters:
Name Type Description
aCamera aCamera the Camera to be drawn to
Source:

getObjectAt(index) → {GameObject}

Returns the GameObject at a specified index of this GameObjectSet
Parameters:
Name Type Description
index integer the set index to access
Source:
Returns:
GameObject at the specified index
Type
GameObject

moveToLast(obj)

Adds the GameObject to the end of set, removing it if already present
Parameters:
Name Type Description
obj GameObject the GameObject to be appened
Source:

removeFromSet(obj)

Remove an GameObject from this GameObjectSet if present
Parameters:
Name Type Description
obj GameObject the GameObject to be removed
Source:

size() → {integer}

Returns the number of GameObjects contained in this GameObjectSet
Source:
Returns:
the length of this set
Type
integer

toggleDrawBound()

Toggles the drawing of each BoundingBox in this GameObjectSet
Source:

toggleDrawRenderable()

Toggles the drawing of each renderable in this GameObjectSet
Source:

toggleDrawRigidShape()

Toggles the drawing of each rigidShape in this GameObjectSet
Source:

update()

Calls update on each GameObject in this set
Source: