Constructor
new WDTraveler(wayDeterminer, source, canvasObject, fromRectopt, xopt, yopt, widthopt, heightopt, dtopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
wayDeterminer |
WayDeterminer | The WayDeterminer instance to use for collisions |
||
source |
Image | The source image to draw from |
||
canvasObject |
CanvasObject | The CanvasObject to draw to |
||
fromRect |
Rectangle |
<optional> |
null | A Rectangle defining where to draw from |
x |
Number |
<optional> |
The x position of the WDTraveler |
|
y |
Number |
<optional> |
The y position of the WDTraveler |
|
width |
Number |
<optional> |
The width of the WDTraveler |
|
height |
Number |
<optional> |
The height of the WDTraveler |
|
dt |
Number |
<optional> |
.6666666667 | delat time, default is tabageos.TimeKeeper._sae |
- See:
Members
_addedPos
_cBB
_cpos
_deltaTime
_inDelay
_moveX
_moveY
_throttRef
_wayDeterminer
The WayDeterminer instance for collisions.
_wic
ani
animationIndexOrder
animationSpecs
blitIndex
constructor
currentAnimation
fromHeightOffset
fromWidthOffset
fromXOffset
fromYOffset
hCheckOffset
hCheckOffsetRight
lastAnim
sae
vCheckOffset
vCheckOffsetUp
Methods
animate(thrott)
Name | Type | Description |
---|---|---|
thrott |
Number |
basicChangeDirectionAnimation()
Changes animation based on dY and dX and _veloc.x and y.
changeDirectionAnimation(left, right, up, down, keepAniIndex)
Changes the animation based on the params given.
Name | Type | Description |
---|---|---|
left |
Boolean | |
right |
Boolean | |
up |
Boolean | |
down |
Boolean | |
keepAniIndex |
{Boolean{ |
delayedAnimateAndBlitt(thrott, milliSecondDelay, animation, clearBeforeBlitt)
Name | Type | Description |
---|---|---|
thrott |
Number | |
milliSecondDelay |
Number | |
animation |
String | |
clearBeforeBlitt |
Boolean |
getBottomY() → {Number}
- Type
- Number
getLeftX() → {Number}
- Type
- Number
getMiddleX() → {Number}
- Type
- Number
getMiddleY() → {Number}
- Type
- Number
getRightX() → {Number}
- Type
- Number
getTopY() → {Number}
- Type
- Number
getUnreferencedPosition(addedX, addedY) → {MoverPoint}
Name | Type | Description |
---|---|---|
addedX |
||
addedY |
- Type
- MoverPoint
landCheckHorizontal(leftRight, pNewX) → {Boolean}
Name | Type | Description |
---|---|---|
leftRight |
||
pNewX |
- Type
- Boolean
landCheckVertical(topBottom, pNewY) → {Boolean}
Name | Type | Description |
---|---|---|
topBottom |
||
pNewY |
- Type
- Boolean
move()
velocity is adjusted using forceApplier, then landCheckHorizontal and landCheckVertical are used to determine collisions, for each direction, if there is no collision velocity is applied to position and x y.