Methods
createSprite()
Generate sprite for a specific item. Sets the position for the sprite if the
item is on the floor.
- Source:
getPosition() → {object}
Get the position of the item. Returns null if not on the floor or in a player's inventory
- Source:
Returns:
- Type
- object
getSpriteSize()
Get the size of the sprite for this item.
- Source:
handleState()
Handle state updates from the server
- Source:
remove()
Remove an item sprite from the list of itemSprites
- Source:
setCoordinates(x, y)
Set coordinates for this item
Parameters:
Name | Type | Description |
---|---|---|
x |
int | new x-coordiante, |
y |
int | new y-coordinate |
- Source:
setPosition(x, y)
Sets the ladder's x and y values.
Parameters:
Name | Type | Description |
---|---|---|
x |
the x value we want to set x | |
y |
the y value we want to set y |
- Source:
update(viewX, viewY)
Update the sprite's position for all items on the floor
Parameters:
Name | Type | Description |
---|---|---|
viewX |
||
viewY |
- Source:
update(viewX, viewY)
Updates the sprite position
Parameters:
Name | Type | Description |
---|---|---|
viewX |
the view x | |
viewY |
the view y |
- Source: