W4tc,
I have finally got around to reading your post properly, and building a response.
These changes should provide the functionality you described:
You'll need to make an array for this.
So you need to initialise the array first, you do that in function LevelSetup() using this command:
seednumber = {}
All the array slots start out with the value nil. We want them to start with the value 0. So initialise the needed slots like this:
for seedset = 1,33 do
seednumber[seedset] = 0
end
Finally, make sure you have set the initial background colour:
SetBackdropColour(255,127,39)
Next, put this code into function LevelLogic, replacing any existing while loops.
while GameRunning() do
for i = 1,4 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] then
SetBackdropColour(0,255,0)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end
for i = 5,7 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] then
SetBackdropColour(155,0,0)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end
for i = 8,14 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] then
SetBackdropColour(0,0,0)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end
for i = 15,33 do
if GetAsteroid(i):GetNumSeedlings(1) > seednumber[i] then
SetBackdropColour(0,0,255)
end
seednumber[i] = GetAsteroid(i):GetNumSeedlings(1)
end
coroutine.yield()
end