Class: ParallaxGameObject

ParallaxGameObject

new ParallaxGameObject(renderableObj, scale, aCamera) → {ParallaxGameObject}

Default Contructor

Represent an GameObject located at some distance D away, thus resulting in slower movements

Passed in scale:

==1: means same as actors

> 1: farther away, slows down inversely (scale==2 slows down twice)

< 1: closer, speeds up inversely (scale==0.5 speeds up twice)

Parameters:
Name Type Description
renderableObj Renderable Renderable to parallax
scale Number Parallax scale
aCamera Camera Camera to refrence
Source:
Returns:
Type
ParallaxGameObject

Methods

getParallaxScale() → {Number}

Return the Paralax scale
Source:
Returns:
parallax scale
Type
Number

setParallaxScale(s) → {void}

Set the Parallax view scale
Parameters:
Name Type Description
s Number Scale of parallax
Source:
Returns:
Type
void

setWCTranslationBy(delta) → {undefined}

Set world coordinate translation delta to change the position of parallax object.
Parameters:
Name Type Description
delta Number Amount to change the position of parallax object.
Source:
Returns:
Type
undefined

update() → {void}

renderableObj xfrom is accessible, it is in WC space!!

GameObject parameters: speed and direction are all in WC space

Source:
Returns:
Type
void