Constructor
new TravelingSceneryThrower(x, y, width, height, map, caopt, dontCloneMapopt, dtopt, tWidthopt, tHeightopt, mropt, mcopt)
Constructs a new TravelingSceneryThrower
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
Number | The x position of the TravelingSceneryThrower |
||
y |
Number | The y position |
||
width |
Number | |||
height |
Number | |||
map |
Array | A 2D Array denoting areas the Traveler can pass or not. 0 or [0,0] would denote a blank passable spot. |
||
ca |
CanavsAnimation |
<optional> |
||
dontCloneMap |
Boolean |
<optional> |
||
dt |
Number |
<optional> |
.6666666667 | |
tWidth |
Number |
<optional> |
||
tHeight |
Number |
<optional> |
||
mr |
Number |
<optional> |
||
mc |
Number |
<optional> |
Members
_canvasAnimation
_displayStorageClearRect
_holdingHelperRect
_outAltered
_removedFromStorage
_tempDivs
constructor
health
holding
The Object or TileData that the TravelingSceneryThrower is holding
holdingOffsetX
The horizontal offset for when holding
holdingOffsetY
The vertical offset for when holding
holdingRect
holdings
nameOfThrower
throwStrength
Methods
_readyNextThrow()
Sets holding to the last value in holdings and updates holdingRect
_throwHolding()
Sets holding to null after first removing it from holdings if in holdings.
alteredPosition(xAlterAmount, yAlterAmount) → {MoverPoint}
Name | Type | Description |
---|---|---|
xAlterAmount |
||
yAlterAmount |
- Type
- MoverPoint
displayStorage(img, cameraLayer, backgroundFromRect, bgx, bgy, tw, th, stx, sty, descriptions)
Displays each value or tileValue in holdings using the given img, backgroundFromRect, and cameraLayer.
Name | Type | Description |
---|---|---|
img |
Img | |
cameraLayer |
CanvasObject | |
backgroundFromRect |
Rectangle | The Rectangle defining where in the image to draw from |
bgx |
Number | The top left of where to draw the background to |
bgy |
Number | The top left of where to draw the background to |
tw |
Number | The tile width |
th |
Number | tile height |
stx |
Number | The starting x position for the first value display |
sty |
Number | The starting y position for the first value display |
descriptions |
Array | An Array of [y,x, description] values where y,x matches the value of values in holdings, will cause a tool tip to appear with the description when user hovers over the displayed value. |
holdingImageRect() → {Rectangle}
Returns holdingRect
- Type
- Rectangle
pickUp(obj, imageWidthAdjust, imageHeightAdjust) → {Boolean}
Picks up the obj and stores it has holding
Name | Type | Description |
---|---|---|
obj |
Object | |
imageWidthAdjust |
Number | adjust the holdingRect width |
imageHeightAdjust |
Number | adjust the holdingRect height |
- Type
- Boolean
pickUpAndStore(obj, imageWidthAdjust, imageHeightAdjust, dontReadyThrow)
Picks up the object and stores it in the holdings Array
Name | Type | Description |
---|---|---|
obj |
Object | |
imageWidthAdjust |
Number | |
imageHeightAdjust |
Number | |
dontReadyThrow |
Boolean | By default the obj is also made ready as holding. |
pickUpAndStoreTileData(obj, imageWidthAdjust, imageHeightAdjust, dontReadyThrow) → {Boolean}
Picks up TileData and stores it in the holdings Array
Name | Type | Description |
---|---|---|
obj |
TileData | |
imageWidthAdjust |
Number | |
imageHeightAdjust |
Number | |
dontReadyThrow |
Boolean | Ready the last value in holdings as holding is the default behavior |
- Type
- Boolean
pickUpTileData(td, imageWidthAdjust, imageHeightAdjust) → {Boolean}
Picks up TileData updating holding and holdingRect
Name | Type | Description |
---|---|---|
td |
TileData | |
imageWidthAdjust |
Number | |
imageHeightAdjust |
Number |
Returns true if TileData was picked up
- Type
- Boolean
rectFromHolding(holdin) → {Rectangle}
Returns the holding Rectangle.
Name | Type | Description |
---|---|---|
holdin |
Object |
- Type
- Rectangle
removeFromDisplayedStorage(e)
Name | Type | Description |
---|---|---|
e |
Object |
removeFromStorageByValue(tValue)
Removes the holding from holdings that has the value given.
Name | Type | Description |
---|---|---|
tValue |
Object |
removeLastFromStorage() → {Object}
Removes the last holding from holdings and sets holding to null.
Returns the last holding value or null.
- Type
- Object
throwSceneryObject(w, h, jumps) → {SceneryObject}
Throws holding as a SceneryObject.
Name | Type | Description |
---|---|---|
w |
Number | |
h |
Number | |
jumps |
Boolean | Default is true for setting _jumps of the SceneryObject to true. |
- Type
- SceneryObject
throwSceneryObjectTraveler(w, h, jumps) → {SceneryObjectTraveler}
Throws holding as a SceneryObjectTraveler
Name | Type | Description |
---|---|---|
w |
Number | |
h |
Number | |
jumps |
Boolean | Default is true, the SceneryObjectTraveler thrown will be effected by gravity. |
valueFromHolding(holdin) → {Object}
Returns the value or tileValue of holdin
Name | Type | Description |
---|---|---|
holdin |
Object |
- Type
- Object