Constructor
# new TaxiPlayer(relPos, carMoveStateopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
relPos |
Vec2
|
The relative start position of the player. |
||
carMoveState |
TaxiAction
|
<optional> |
TaxiAction.Left | The car move state at the start. |
Methods
# carMoveState() → {TaxiAction}
The car move state for the visualization
# detectCollision(action) → {boolean}
Collision detection logic for the collision with walls
Parameters:
Name | Type | Description |
---|---|---|
action |
TaxiAction
|
The action that was performed |
true if a collision with the wall was detected.
boolean
# updatePosition(action) → {void}
Update the player position according to the taken action
Parameters:
Name | Type | Description |
---|---|---|
action |
TaxiAction
|
the action taken |
void