Class: BHell_Mover_Bounce

BHell.BHell_Mover_Bounce()

new BHell_Mover_Bounce()

Bounce movement class. Moves to the starting position, then moves in a straight line at a given angle, bouncing on the screen's borders.

Source:

Extends

Methods

initialize(x, y, angle, w, h)

Constructor

Parameters:
Name Type Description
x

X coordinate of the initial position.

y

Y coordinate of the initial position.

angle

Initial angle.

w

Width of the object to move.

h

Height of the object to move.

Overrides:
Source:

move(oldX, oldY, speed) → {Array}

Moves to the starting position, then moves at this.angle, bouncing on the screen's borders.

Parameters:
Name Type Description
oldX

Old x coordinate.

oldY

Old y coordinate.

speed

Movement speed. In pixels per frame.

Overrides:
Source:
Returns:
Type
Array