Endy
04-07-2008, 04:52 AM
Found a bug in how the Can's deaths are handled that allows the player to skip the whole level if they kill several cans in a row while they are still being created. Fixed it by setting g_enemiesLeft right after enemiesToSpawn is set.
ie.
local enemiesToSpawn = 5 * levelNum;
g_EnemiesLeft = enemiesToSpawn;
Also removed the redundent onAddEnemy function and associated call.
The for loop is also off, it creates one more Can than enemiesToSpawn specifies, due to the for=0. Changing it to for=1 corrects this.
ie.
local enemiesToSpawn = 5 * levelNum;
g_EnemiesLeft = enemiesToSpawn;
Also removed the redundent onAddEnemy function and associated call.
The for loop is also off, it creates one more Can than enemiesToSpawn specifies, due to the for=0. Changing it to for=1 corrects this.