Particle thingy I tried :P
Author |
Message |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
TerranceN
|
Posted: Sun Jan 30, 2011 11:31 am Post subject: Re: Particle thingy I tried :P |
|
|
First of all, your class does not represent a single particle, as its name suggests, instead it represents a particle spawner. Second, why does your Particle class inherit from backImage? I'm going to guess you mean import. Also, why didn't you encapsulate all those parallel arrays into a record or class? It would have made your code much more readable.
Next time you ask for help, unless your code is self documenting or simple, please include a comment or two explaining what everything is supposed to do, cause it took me awhile to understand what everything was supposed to do.
Now onto the problem. From what I have read of your code, indexSize is the maximum index that contains particles whose particleDraw value is true, so this loop will never find a particle whose particleDraw value is false.
Turing: |
for i : 0 .. indexSize
if particleDraw (i) = false then
dynIndex := i
exit
end if
end for
|
Instead change the upper bound to upper(particleDraw), so that it will check all particles.
|
|
|
|
|
![](images/spacer.gif) |
|
|