Skip to content

Commit 053d64e

Browse files
committed
Fixed minor paintstack game type bug.
1 parent 72a8dda commit 053d64e

2 files changed

Lines changed: 52 additions & 12 deletions

File tree

src/Color.js

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,32 @@
1010
function Color() {
1111
//COLORS LIB
1212
this.Color_OceanBlue = 0x99FFFF,
13-
this.Color_SteelBlue = 0x4682B4,
14-
this.Color_RoyalBlue = 0xFF0000,
15-
this.Color_DarkBlue = 0x0099FF,
16-
this.Color_Black = 0x000000,
17-
this.Color_Violet = 0xEE82EE,
18-
this.Color_Yellow = 0xFFFF00,
19-
this.Color_Tomato = 0xFF6347,
20-
this.Color_PaleVioletRed = 0xDB7093,
21-
this.Color_Red = 0xFF0000,
22-
this.Color_Wheat = 0xF5DEB3,
23-
this.Color_AntiqueWhite = 0xFAEBD7,
24-
this.Color_White = 0xFFFFFF;
13+
this.Color_SteelBlue = 0x4682B4,
14+
this.Color_RoyalBlue = 0x4169E1,
15+
this.Color_Aquamarine = 0x7FFFD4,
16+
this.Color_Blue = 0x0000FF,
17+
this.Color_BlueViolet = 0x8A2BE2,
18+
this.Color_CadetBlue = 0x5F9EA0,
19+
this.Color_CornflowerBlue = 0x6495ED,
20+
this.Color_Cyan = 0x00FFFF,
21+
this.Color_DarkBlue = 0x00008B,
22+
this.Color_DarkCyan = 0x008B8B,
23+
this.Color_DodgerBlue = 0x1E90FF,
24+
this.Color_DeepSkyBlue = 0x00BFFF,
25+
this.Color_LightSteelBlue = 0xB0C4DE,
26+
this.Color_Navy = 0x000080,
27+
this.Color_PowderBlue = 0xB0E0E6,
28+
this.Color_Turquoise = 0x40E0D0,
29+
30+
this.Color_Black = 0x000000,
31+
this.Color_Violet = 0xEE82EE,
32+
this.Color_Yellow = 0xFFFF00,
33+
this.Color_Tomato = 0xFF6347,
34+
this.Color_PaleVioletRed = 0xDB7093,
35+
this.Color_Red = 0xFF0000,
36+
this.Color_Wheat = 0xF5DEB3,
37+
this.Color_AntiqueWhite = 0xFAEBD7,
38+
this.Color_White = 0xFFFFFF;
2539
}
2640

2741
Color.prototype.generateHexColor = function () {

src/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,32 @@ function update() {
243243
//expand grid when over 70% of it is marked
244244
if(Math.floor(actor.markedArea)>70)
245245
expand();
246+
else if(enemy.length === 0){
247+
248+
for (var i = 0; i <Math.ceil((gameStateRestarts+1)/2); i++) {
249+
var x = '';
250+
if (randomBoolean[0]() == true) {
251+
if (randomBoolean[0]() == true)
252+
x = '0-' + getRandomInt(0, cellsCntY);
253+
else
254+
x = getRandomInt(0, cellsCntX) + '-0';
255+
} else {
256+
if (randomBoolean[0]() == true)
257+
x = (cellsCntX - 1) + '-' + getRandomInt(0, cellsCntY);
258+
else
259+
x = getRandomInt(0, cellsCntX) + '-' + (cellsCntY - 1);
260+
}
261+
262+
if (grid.cell[grid.getCell(x)].type === 'Normal')
263+
enemy.push(new Enemy(enemiesColor, x));
264+
else
265+
i--;
266+
}
267+
268+
for (var x = 0; x < enemy.length; x++)
269+
enemy[x].init();
270+
}
271+
246272
}
247273
} else {
248274

0 commit comments

Comments
 (0)