MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / moveVertically

Method moveVertically

code/main/TheSea.ts:472–484  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

470 }
471
472 private moveVertically(): void{
473 var upPressed: boolean = Keyboard.isKeyPressed("up");
474 var downPressed: boolean = Keyboard.isKeyPressed("down");
475
476 if(upPressed && !downPressed){
477 this.getGame().getPlayer().move(new Pos(0, -1));
478 this.lastPlayerMovement.y = -1;
479 }
480 else if(downPressed && !upPressed){
481 this.getGame().getPlayer().move(new Pos(0, 1));
482 this.lastPlayerMovement.y = 1;
483 }
484 }
485
486 private scrollFloor(howMany: number): void{
487 for(var i = howMany; i <= 99 + this.generationProjection; i++){

Callers 1

updateMethod · 0.95

Calls 3

getPlayerMethod · 0.80
moveMethod · 0.45
getGameMethod · 0.45

Tested by

no test coverage detected