MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / constructor

Method constructor

Player.js:20–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19class PlayerState {
20 constructor() {
21 this.currentPos = createVector(width / 2, height - 200); // this is the top left corner of the hitbox
22 this.currentSpeed = createVector(0, 0);
23 this.isOnGround = false;
24
25
26 this.blizzardForce = 0;
27 this.blizzardForceAccelerationDirection = 1;
28 this.maxBlizzardForceTimer = 0;
29 this.snowImagePosition = 0;
30
31
32 this.bestHeightReached = 0;
33 this.bestLevelReached = 0;
34 this.reachedHeightAtStepNo = 0;
35 this.bestLevelReachedOnActionNo = 0;
36
37 this.brainActionNumber = 0
38
39 this.currentLevelNo = 0;
40 this.jumpStartingHeight = 0;
41 this.facingRight = true;
42
43
44 this.isWaitingToStartAction = false;
45 this.actionStarted = false;
46
47 }
48
49 getStateFromPlayer(player) {
50 this.currentPos = player.currentPos.copy();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected