Class: ObjectType

ObjectType

FM.ObjectType

new ObjectType(pName)

An object type can be associated to a game object. Then all game objects of a certain type can be processed uniformally through the object type object.
Parameters:
Name Type Description
pName string The name of the object type.
Author:
  • Simon Chauvin.
Source:

Methods

addTypeToCollideWith(pType)

Ensure that the game objects of the current type collide with a specified one.
Parameters:
Name Type Description
pType FM.ObjectType The type to collide with to add to all game objects of this type.
Source:

destroy()

Destroy the type.
Source:

getName() → {string}

Retrieve the name of the type.
Source:
Returns:
The name of the type.
Type
string

hide()

Hide all the game objects of this type.
Source:

isAlive() → {boolean}

Check if the game objects of this type are alive.
Source:
Returns:
Whether all the game objects of this type are alive.
Type
boolean

isVisible() → {boolean}

Check if the game object of this type are visible.
Source:
Returns:
Whether all the game objects of this type are visible.
Type
boolean

kill()

Kill all the game objects of this type.
Source:

overlapsWithObject(pGameObject) → {FM.Collision}

Check if the game objects of the current type are overlapping with a specified game object.
Parameters:
Name Type Description
pGameObject FM.GameObject Game object to test with the game objects of the current type.
Source:
Returns:
Collision object if there is overlapping.
Type
FM.Collision

overlapsWithType(pType) → {FM.Collision}

Check if the game objects of the current type overlap with the game objects of the given type.
Parameters:
Name Type Description
pType FM.ObjectType The type to test if it overlaps with the current one.
Source:
Returns:
Collision object if there is overlapping.
Type
FM.Collision

removeTypeToCollideWith(pType)

Remove a type that was supposed to collide with all the game objects of this type.
Parameters:
Name Type Description
pType FM.ObjectType The type to collide with to remove from all game objects of this type.
Source:

revive()

Revive all the game objects of this type.
Source:

setScrollFactor(pScrollFactor)

Set the scrollFactor of every game objects of the current type.
Parameters:
Name Type Description
pScrollFactor FM.Vector The factor of scrolling to apply to all game objects of this type.
Source:

setZIndex(pZIndex)

Set the z-index of every game objects of the current type.
Parameters:
Name Type Description
pZIndex int The z index at which all game objects of this type must be.
Source:

show()

Show all the game objects of this type.
Source: