-
Notifications
You must be signed in to change notification settings - Fork 7
client.controllers.Direction.Direction
Mahatma Kollu edited this page Oct 19, 2021
·
2 revisions
client/controllers/Direction.Direction
Manages the sending of what direction the player is facing (either "UP" or "DOWN") to the server thorugh the Direction event.
example
WRITTEN: player rotates their camera up, fast enough to trigger the "if (this.prevX !== x && math.abs(this.prevX - x) >= 0.02)" to evaluate to true which sets the direction to "UP" and fires the direction event with the direction.
OnInit
• Private Direction: "DOWN" | "UP" = "DOWN"
stores the direction the player's camera is facing in
src/client/controllers/Direction.ts:22
• Private prevX: number = 0
stores the amount of heartbeats the camera has moved in a direction
src/client/controllers/Direction.ts:24
▸ onInit(): void
void
OnInit.onInit
- client/controllers/SpringCam
- client/controllers/Direction
- client/controllers/Rotation
- client/controllers/Shake
- client/controllers/Input
- server/modules/InputParser
- server/modules/Middleware
- server/modules/AnimPlayer
- server/modules/Action
- server/modules/Defer