If you send the complete code to otterstudios@hotmail.co.uk I’d be happy to take a look.
Nick
Did you skip my third post cuz the viewer made the code look weird?
I did it for you, just copy paste this code in a brand new lua file and it should do what you want it too. Thanks for the interesting problem =)
----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- Your code here display.setStatusBar( display.HiddenStatusBar ) myEnemies = {} enemyNr = {} eNum = 1 function killEveryone(event) if event.phase == "ended" then timer.cancel( SpawnTimer ) for i = 1, #enemyNr do myEnemies[enemyNr[i]]:removeSelf() myEnemies[enemyNr[i]] = nil end end end killBut = display.newRect( 110, 0, 100, 40 ) killBut:addEventListener( "touch", killEveryone ) function killGuys(event) if event.phase == "began" then local target = event.target local deadEnemy = event.target.num local remEnem = table.indexOf( enemyNr, deadEnemy ) table.remove( enemyNr, remEnem ) target:removeSelf() target = nil end end function spawnGuys() myEnemies[#myEnemies + 1] = display.newCircle( math.random( 20, 300), math.random( 40, 460 ), 20 ) myEnemies[#myEnemies].num = #myEnemies enemyNr[#enemyNr + 1] = #myEnemies myEnemies[#myEnemies]:addEventListener( "touch", killGuys ) end SpawnTimer = timer.performWithDelay( 500, spawnGuys, -1 )
@hatethinkingofgames, thanks, i’ll give this a try asap. when i get back to the office.
@nick_sherman, as soon as i return i can zip up the project for you
finally got back to my computer… busy week. ill keep you updated
no errors thus far