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

Method getStateFromPlayer

Player.js:49–73  ·  view source on GitHub ↗
(player)

Source from the content-addressed store, hash-verified

47 }
48
49 getStateFromPlayer(player) {
50 this.currentPos = player.currentPos.copy();
51 this.currentSpeed = player.currentSpeed.copy();
52 this.isOnGround = player.isOnGround
53
54
55 this.blizzardForce = player.blizzardForce;
56 this.blizzardForceAccelerationDirection = player.blizzardForceAccelerationDirection;
57 this.maxBlizzardForceTimer = player.maxBlizzardForceTimer;
58 this.snowImagePosition = player.snowImagePosition;
59
60
61 this.bestHeightReached = player.bestHeightReached;
62 this.bestLevelReached = player.bestLevelReached;
63 this.reachedHeightAtStepNo = player.reachedHeightAtStepNo;
64 this.bestLevelReachedOnActionNo = player.bestLevelReachedOnActionNo;
65 this.brainActionNumber = player.brain.currentInstructionNumber;
66
67 this.currentLevelNo = player.currentLevelNo;
68 this.jumpStartingHeight = player.jumpStartingHeight;
69 this.facingRight = player.facingRight;
70
71 this.isWaitingToStartAction = player.isWaitingToStartAction;
72 this.actionStarted = player.actionStarted;
73 }
74
75 loadStateToPlayer(player) {
76 player.currentPos = this.currentPos.copy();

Callers 1

UpdateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected