Members
scene
Global variables
Methods
animate() → {None}
Animates the scene
Returns:
- Type
- None
createPlayer(scene) → {None}
Creates THREE.js player with THREE.js camera perspective and predetermined controls
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE | The world instance of the game |
Returns:
- Type
- None
createSpace(scene) → {None}
Creates THREE.js geometric floor, walls, and ceiling to create scene
of playing area
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE | The world instance of the game |
Returns:
- Type
- None
getRandomLoc(min, max) → {number}
Randomizes location of target to click
Parameters:
Name | Type | Description |
---|---|---|
min |
int | The int specifying the min -- lower bound. |
max |
int | The int specifying the max -- lower bound. |
Returns:
Location of target
- Type
- number
getRandomSize(min, max) → {number}
Randomizes size of target to click
Parameters:
Name | Type | Description |
---|---|---|
min |
int | The int specifying the min -- lower bound. |
max |
int | The int specifying the max -- lower bound. |
Returns:
Size of target
- Type
- number
init() → {None}
Initializes the world, game, player, and targets
Returns:
- Type
- None
keyDown(event) → {None}
Detects when a key has been pressed down
Parameters:
Name | Type | Description |
---|---|---|
event |
event | Keyboard event |
Returns:
- Type
- None
keyUp(event) → {None}
Detects when a key has been pressed down
Parameters:
Name | Type | Description |
---|---|---|
event |
event | Keyboard event |
Returns:
- Type
- None
lockCursor(havePointerLock) → {None}
Checks browser to see if cursor can be locked, locks cursor
if so otherwise present error message.
Parameters:
Name | Type | Description |
---|---|---|
havePointerLock |
boolean | The boolean determining whether browser is capable of pointer lock. |
Returns:
- Type
- None
onWindowResize() → {None}
Handles window resizing
Returns:
- Type
- None
render(scene) → {None}
Renders THREE.js WebGL scene
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE | The world instance of the game |
Returns:
- Type
- None
spawnTarget(scene) → {None}
Spawns THREE.js geometric target with position and size determined from
getRandomLoc() and getRandomSize()
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE | The world instance of the game |
Returns:
- Type
- None