BasicPlatformer

BasicPlatformer

new BasicPlatformer(x, y, width, height, map, ca, dontCloneMapopt, dtopt, tWidthopt, tHeightopt, mropt, mcopt, mapOfOriginalTiles, controller, ladderTileValue)

A TravelingSceneryThrower designated as a Platformer character. BasicPlatformer climbs ladders designated by the ladderTileValue, and is ready for a 'climb' animation.

Parameters:
Name Type Attributes Default Description
x Number
y Number
width Number
height Number
map Array
ca CanvasAnimation
dontCloneMap Boolean <optional>
false
dt Number <optional>
.6666666667

delta time

tWidth Number <optional>

tile width

tHeight Number <optional>

tile height

mr Number <optional>

map rows

mc Number <optional>

map columns

mapOfOriginalTiles Array

uncloned version of map containing ladder tile values.

controller ControllerPad

a reference to the games ControllerPad instance.

ladderTileValue Object

tile value in map that denotes a ladder tile.

Members

_hlpp

constructor

ladderValue

The value of tiles that are ladders.

onLadder

onMovingPlatform

tile

tileDown

tileLeft

tilelUp

tileMap

tileRight

Methods

_addedToChangeDirectionAni(left, right, up, down, keepAniIndex, noIdle)

This method becomes part of this class' CanvasAnimation's changeDirectionAnimation function. This class utilizes this method to add ladder climbing functionality and the 'climb' animation.

The ladder tile value is defined during construction, then if a climb animation is defined, when on the ladder the class will switch to the climb animation. The ladder tile value should be a tile the BasicPlatformer does not collide with.

Parameters:
Name Type Description
left
right
up
down
keepAniIndex
noIdle

getValuesOfCloseTiles(map)

Populates tile, tileUp, tileDown, tileLeft and tileRight with the values of those tiles found in tileMap.

Parameters:
Name Type Description
map

valuesMatch(val1, val2) → {Boolean}

Returns true if the values match.

Parameters:
Name Type Description
val1 Object
val2 Object
Returns:

Returns true if the values match.

Type
Boolean