Gamepad

platypus. Gamepad

new Gamepad(gamepad, id, deadzone, height) → {platypus.Gamepad}

This class defines an axis-aligned bounding box (AABB) which is used during the collision process to determine if two objects are colliding. This is used in a few places including CollisionBasic and [[Collision-Shape]].

Source:
Parameters:
Name Type Description
gamepad number

The browser's gamepad object.

id number

Id of gamepad.

deadzone number

distance from axis 0 position to ignore.

height number

The height of the AABB.

Returns:
Type:
platypus.Gamepad

Returns the new aabb object.

Methods

(static) recycle(gamepad)

Returns a Gamepad back to the cache.

Source:
Parameters:
Name Type Description
gamepad platypus.Gamepad

The Gamepad to be recycled.

(static) setUp() → {platypus.Gamepad}

Returns an Gamepad from cache or creates a new one if none are available.

Source:
Returns:
Type:
platypus.Gamepad

The instantiated Gamepad.

recycle()

Relinquishes properties of the Gamepad and recycles it.

Source: