When I run the KillEveryone() function I expectthe three victims in myKillList array to update their dead variable but they all remain as zero?!
Global myKillList as TVictim[] // Create Kill list of victims
Global dave as TVictim // Add Victim
myKillList.insert(dave)
Global emma as TVictim // Add Victim
myKillList.insert(emma)
Global carl as TVictim // Add Victim
myKillList.insert(carl)
Type TVictim // Victim Object
dead as Integer
EndType
Function KillEveryone() // Flag every victim on myKillList as dead
For i = 0 To myKillList.Length
myKillList[i].dead=1
Next
Endfunction
do // Loop
if GetRawKeyPressed(32) then KillEveryone() // Press Space
Print ("dave: "+str(dave.dead))
Print ("emma: "+str(emma.dead))
Print ("carl: "+str(carl.dead))
loop