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

Method loadStateToPlayer

Player.js:75–104  ·  view source on GitHub ↗
(player)

Source from the content-addressed store, hash-verified

73 }
74
75 loadStateToPlayer(player) {
76 player.currentPos = this.currentPos.copy();
77 player.currentSpeed = this.currentSpeed.copy();
78 player.isOnGround = this.isOnGround
79
80
81 player.blizzardForce = this.blizzardForce;
82 player.blizzardForceAccelerationDirection = this.blizzardForceAccelerationDirection;
83 player.maxBlizzardForceTimer = this.maxBlizzardForceTimer;
84 player.snowImagePosition = this.snowImagePosition;
85
86 // player.blizzardForce = 0;
87 // player.blizzardForceAccelerationDirection = 1;
88 // player.maxBlizzardForceTimer = 0;
89 // player.snowImagePosition = 0;
90
91 player.bestHeightReached = this.bestHeightReached;
92 player.bestLevelReached = this.bestLevelReached;
93 player.reachedHeightAtStepNo = this.reachedHeightAtStepNo;
94 player.bestLevelReachedOnActionNo = this.bestLevelReachedOnActionNo;
95 player.brain.currentInstructionNumber = this.brainActionNumber;
96
97 player.currentLevelNo = this.currentLevelNo;
98 player.jumpStartingHeight = this.jumpStartingHeight;
99 player.facingRight = this.facingRight;
100
101
102 // player.isWaitingToStartAction = this.isWaitingToStartAction;
103 // player.actionStarted = this.actionStarted;
104 }
105
106 clone() {
107 let clone = new PlayerState();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected