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

Method getSpellCastingPosition

code/main/Player.ts:108–127  ·  view source on GitHub ↗
(facingRight: boolean = true)

Source from the content-addressed store, hash-verified

106 }
107
108 public getSpellCastingPosition(facingRight: boolean = true): Pos{
109 switch(this.characterType){
110 case PlayerCharacterType.CANDYBOX:
111 if(facingRight) return this.getGlobalPosition().plus(new Pos(3, -1));
112 else return this.getGlobalPosition().plus(new Pos(-1, -1));
113 break;
114 case PlayerCharacterType.MEDIUM:
115 if(facingRight) return this.getGlobalPosition().plus(new Pos(11, 0));
116 else return this.getGlobalPosition().plus(new Pos(-1, 0));
117 break;
118 case PlayerCharacterType.CANDYBOX_SQUEEZED:
119 if(facingRight) return this.getGlobalPosition().plus(new Pos(0, -1));
120 else return this.getGlobalPosition().plus(new Pos(0, -1));
121 break;
122 case PlayerCharacterType.MEDIUM_SQUEEZED:
123 if(facingRight) return this.getGlobalPosition().plus(new Pos(6, 0));
124 else return this.getGlobalPosition().plus(new Pos(-1, 0));
125 break;
126 }
127 }
128
129 public getThornsPositionsArray(): Pos[]{
130 // Create the array

Callers 6

castPlayerFireballMethod · 0.80
castPurpleBallMethod · 0.80
summonMethod · 0.80
castFireballMethod · 0.80
castFireballMethod · 0.80

Calls 2

plusMethod · 0.80
getGlobalPositionMethod · 0.80

Tested by

no test coverage detected