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

Method drawBackground

code/main/Hell.ts:125–144  ·  view source on GitHub ↗
(x: number, y: number)

Source from the content-addressed store, hash-verified

123 }
124
125 private drawBackground(x: number, y: number): void{
126 // Draw the ascii
127 this.getRenderArea().drawArray(Database.getAscii("places/quests/hell/background"), this.getRealQuestPosition().x + x, this.getRealQuestPosition().y + y);
128
129 // Add the red color for the first lava pit
130 this.drawLava(x + 55, x + 71, y + 4);
131 this.drawLava(x + 54, x + 72, y + 5);
132 this.drawLava(x + 53, x + 73, y + 6);
133 this.drawLava(x + 52, x + 74, y + 7);
134 this.drawLava(x + 51, x + 75, y + 8);
135 this.drawLava(x + 51, x + 75, y + 9);
136
137 // Same thing for the second pit
138 this.drawLava(x + 94, x + 106, y + 4);
139 this.drawLava(x + 93, x + 107, y + 5);
140 this.drawLava(x + 92, x + 108, y + 6);
141 this.drawLava(x + 91, x + 109, y + 7);
142 this.drawLava(x + 90, x + 110, y + 8);
143 this.drawLava(x + 90, x + 110, y + 9);
144 }
145
146 private drawLava(x1: number, x2: number, y: number): void{
147 this.getRenderArea().addBackgroundColor(this.getRealQuestPosition().x + x1, this.getRealQuestPosition().x + x2, this.getRealQuestPosition().y + y, new Color(ColorType.HELL_RED_LAVA));

Callers 1

updateMethod · 0.95

Calls 5

drawLavaMethod · 0.95
drawArrayMethod · 0.80
getAsciiMethod · 0.80
getRealQuestPositionMethod · 0.80
getRenderAreaMethod · 0.45

Tested by

no test coverage detected