Class: GameObject

GameObject(game, boundingBox)

Defines the base functionality of interactive game objects

Constructor

new GameObject(game, boundingBox)

Creates a base GameObject
Parameters:
Name Type Description
game Object The game manager class
boundingBox Object Initial size and position of this GameObject
Source:

Extends

Members

dimensions

Gets the bounding box dimensions of this Object
Source:

Methods

AbstractMethod(methodName)

Raises an error if an abstract base class method is called
Parameters:
Name Type Description
methodName string The name of the method that is abstract
Overrides:
Source:

collision(object) → {boolean}

Simple collision test between this GameObject and another
Parameters:
Name Type Description
object Object The GameObject to check for intersection
Source:
Returns:
true/false if colliding
Type
boolean

draw()

Abstract interface definition for the draw method. Must be overridden in derived classes.
Source:

intersects(object) → {Object}

Performs a comprehensive collision test that checks where the two objects are overlapping and indicates the closest point to move them out of collision.
Parameters:
Name Type Description
object Object The object to check for intersection
Source:
Returns:
a dictionary with side: axis of intersection and pos: closest point of non-intersection
Type
Object