hi all,
so this is the first time i really try to work with those list in director. i'm trying to build an invaders game. everything fine so far.
no, i have a list with the spirtenumbers of the invaders in it. like this:
pPossibleTargets = [3,4,5,6,7,8,9,10]
then i want to check with the bullet script, if one of the invaders is hit, with the following script:
repeat with i in pPossibleTargets
if sprite(the currentSpriteNum).intersects(i) then
hit sprite(i)
pPossibleTargets.deleteOne(i)
put pPossibleTargets
if pPossibleTargets = [] then
end if
pShooting = false
sprite(the currentSpriteNum).locV = -50
end if
end repeat
when the first shot hits an invader, the script works. the handler hit is excecuted and the listentry is deleted. when the secondtime the bullet hits though, i get the follwing error message:
script error: list expectet for handler
repeat with i in pPossibleTargets
#getAt
i'm confident that somebody can help me out with this problem.
tnx in advance
adrian
so this is the first time i really try to work with those list in director. i'm trying to build an invaders game. everything fine so far.
no, i have a list with the spirtenumbers of the invaders in it. like this:
pPossibleTargets = [3,4,5,6,7,8,9,10]
then i want to check with the bullet script, if one of the invaders is hit, with the following script:
repeat with i in pPossibleTargets
if sprite(the currentSpriteNum).intersects(i) then
hit sprite(i)
pPossibleTargets.deleteOne(i)
put pPossibleTargets
if pPossibleTargets = [] then
end if
pShooting = false
sprite(the currentSpriteNum).locV = -50
end if
end repeat
when the first shot hits an invader, the script works. the handler hit is excecuted and the listentry is deleted. when the secondtime the bullet hits though, i get the follwing error message:
script error: list expectet for handler
repeat with i in pPossibleTargets
#getAt
i'm confident that somebody can help me out with this problem.
tnx in advance
adrian