Class

TaxiPlayer

TaxiPlayer(relPos, carMoveStateopt)

The Player class

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.

View Source core/src/Games/TaxiGame/Player.ts, line 12

Members

Vec2

# carMoveState

The car move state for the visualization

View Source core/src/Games/TaxiGame/Player.ts, line 38

Vec2

# position

The player position

View Source core/src/Games/TaxiGame/Player.ts, line 31

Vec2

# position

Set the position

View Source core/src/Games/TaxiGame/Player.ts, line 45

Methods

# carMoveState() → {TaxiAction}

The car move state for the visualization

View Source core/src/Games/TaxiGame/Player.ts, line 95

TaxiAction

# detectCollision(action) → {boolean}

Collision detection logic for the collision with walls

Parameters:
Name Type Description
action TaxiAction

The action that was performed

View Source core/src/Games/TaxiGame/Player.ts, line 111

true if a collision with the wall was detected.

boolean

# position(pos)

Set the position

Parameters:
Name Type Description
pos Vec2

View Source core/src/Games/TaxiGame/Player.ts, line 103

# updatePosition(action) → {void}

Update the player position according to the taken action

Parameters:
Name Type Description
action TaxiAction

the action taken

View Source core/src/Games/TaxiGame/Player.ts, line 119

void