Posted By: DestroyTheRunner
Best way to do things ( random grass generator) - 01/24/08 15:55
Hi
I have a function that generates 500 sprites of a grass image(32bits TGA)
in randomly positions over the level.
I found out that I needed a bit more than 1000 to cover my level decently.
So i made a function that any sprite that is X(eg. 5000) quants farther from the player, gets its invisble flag on.(for speed and rendering improvment)
But IF i make a function that maintan a max number of sprites 200(which is enough to fool the vision of the player) and as i walk, it creates and removes sprites using the same distance comparison.
Which one do you think is the best? ( speed, memory, rendering...)
ps. IŽm not using no ones particular generator code and no generator tutorial code(if there is any).
thanks
I have a function that generates 500 sprites of a grass image(32bits TGA)
in randomly positions over the level.
I found out that I needed a bit more than 1000 to cover my level decently.
So i made a function that any sprite that is X(eg. 5000) quants farther from the player, gets its invisble flag on.(for speed and rendering improvment)
But IF i make a function that maintan a max number of sprites 200(which is enough to fool the vision of the player) and as i walk, it creates and removes sprites using the same distance comparison.
Which one do you think is the best? ( speed, memory, rendering...)
ps. IŽm not using no ones particular generator code and no generator tutorial code(if there is any).
thanks