new Secondary_Player()
a class that represents any player that is not the one the user is actively controlling.
Extends
Methods
-
getInputDirection()
-
This function is how the movement controller determines if the player should move in a direction when a movement event is triggered.
Might need to be expanded in future to accommodate gamepadsReturns:
-0 if not moving
2 if down
8 if up
6 if right
4 if left -
isOnMap() → {bool}
-
check if this player is on the map
Returns:
bool -if this player is on the map
- Inherited From:
-
moveOneTile()
-
set the dir4 current control. dir4 is the direction on the arrow keys.
- Inherited From:
-
setMoveSpeed()
-
override the set move speed method to emit the event as well
- Inherited From:
-
setTorch(bool)
-
set whether this player currently has a torch out
Parameters:
Name Type Description bool
bool whether the player has a torch active or not
Returns:
-void
-
setTransparent(bool, doNotEmit)
-
the overridden method for set transparent overridden to emit its event
Parameters:
Name Type Description bool
boolean whether the player is transparent or visible
doNotEmit
boolean whether to not send this event to net clients or not
- Inherited From:
-
torchIsLit() → {boolean}
-
check if this player currently has a torch out
Returns:
boolean -
updateDashing()
-
override the update dashing method to emit the dash event when there is a change in dashing
- Inherited From: