CameraShake

Used to add a shake effect to the game camera.

Constructor

new CameraShake(camera, strength, length)

Create a new CameraShake Object.
Parameters:
NameTypeDefaultDescription
cameraCameraCamera to be owned by
strengthnumberIntensity of the effect
lengthnumber1Duration of the effect

Methods

_make()

Initializes the effect.

remove()

Remove the effect from the camera.

update(elapsed)

Update the camera shake effect.
Parameters:
NameTypeDescription
elapsednumberTime since last update in seconds