Gamalto

Fork me on GitHub

Object Movable Overview

Gamalto. Movable

new Gamalto.Movable()

Base object to create a movable entity. It's not meant to be used directly.

Extends

Members

tag :object

inherited

Utility property to exchange data between objects.

Inherited From

Methods

clone() object

inherited abstract

Clones the object. It will be shallow copy unless otherwise specfied.

Inherited From
Returns
  • New instance of the object. Defaults to null.

reset()

Resets the motion properties of the movable entity.

setSpeed(sx, sy)

Sets the maximum motion speed of the entity.

Parameters
Name Type Description
sx number

Maximum horizontal speed in pixels per second.

sy number

Maximum vertical speed in pixels per second.

toString() string

inherited abstract

Converts the object into a string.

Inherited From
Returns
  • string

update(timer, dx, dy) Gamalto.Vector2

Updates the internal motion state of the movable entity.

Parameters
Name Type Description
timer Gamalto.ITiming

Timer from which the elapsed time will be read.

dx number

Value beween -1 and +1 indicating the horizontal drection.

dy number

Value beween -1 and +1 indicating the vertical direction.

Returns
  • Effective displacement to be applied to the entity in pixels.

Documentation generated by JSDoc 3.3.2 on Sun Sep 13 2015 20:13:31 GMT+0200 (CEST)