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

Method move

code/main/Smoke.ts:58–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56 }
57
58 public move(): void{
59 if(this.weAreWaiting == false){
60 // We make the smoke going up
61 this.yGap--;
62
63 // If it's too high, we call init()
64 if(-this.yGap >= this.height){
65 this.init();
66 }
67 // Else we invert it
68 else{
69 this.inverted = !this.inverted;
70 }
71 }
72 else{
73 this.currentWaitingTime++;
74 if(this.currentWaitingTime > this.chosenWaitingTime)
75 this.weAreWaiting = false;
76 }
77 }
78
79 // Private methods
80 private init(weMustBeWaitingAtFirst: boolean = true): void{

Callers 5

actionSmokesMethod · 0.45
moveVerticallyMethod · 0.45
actionSmokesMethod · 0.45
handlePondMethod · 0.45
moveHorizontallyMethod · 0.45

Calls 1

initMethod · 0.95

Tested by

no test coverage detected