Class: Maze_Player

Maze.Maze_Player()

new Maze_Player()

Player class for the 3D mazes. At each movement synchronises $gamePlayer.

Source:

Methods

goto(x, y, direction)

Teleports the player.

Parameters:
Name Type Description
x

X coordinate of the destination.

y

Y coordinate of the destination.

direction

Direction (2-4-6-8) to be faced.

Source:

initialize(cameraDistance, cameraWidth, speed, rotationSpeed)

Constructor. Initializes the player parameters and the raycaster's camera.

Parameters:
Name Type Description
cameraDistance

Camera distance from the player.

cameraWidth

Camera plane width.

speed

Player's speed.

rotationSpeed

Player's rotation speed.

Source:

moveBackward()

Makes the player step backward.

Source:

moveForward()

Makes the player step forward.

Source:

rotateLeft()

Rotates the player counterclockwise.

Source:

rotateRight()

Rotates the player clockwise.

Source:

strafeLeft()

Makes the player step sideways to the left.

Source:

strafeRight()

Makes the player step sideways to the right.

Source:

update()

Synchronises $gamePlayer with the maze player.

Source: