Drawing
Posted: Sun Jan 25, 2009 2:24 pm
Hi,
I'm making a game, and it basically consists of the player controlling a circle shape.
As the circle shape moves around, it leaves a trail of where it's been since it started moving. It's not scrolling or anything, just on the one screen that is visible from beginning to end.
How can I draw this trail? The draw function seems to 'erase' the screen each time, so it only draws the current position of the circle.
I'm guessing that I need to find some way of 'storing' the trail (by co-ordinates?) and then repaint them every frame. How can I store this trail then?
But then if I do that, wouldn't the game become very slow, having to draw so much, after having moved all over the screen?
Is there way to not have the draw function wipe the screen, and instead just 'add' the current position o the circle instead? That seems like it would be a lot easier and faster.
Thanks!
I'm making a game, and it basically consists of the player controlling a circle shape.
As the circle shape moves around, it leaves a trail of where it's been since it started moving. It's not scrolling or anything, just on the one screen that is visible from beginning to end.
How can I draw this trail? The draw function seems to 'erase' the screen each time, so it only draws the current position of the circle.
I'm guessing that I need to find some way of 'storing' the trail (by co-ordinates?) and then repaint them every frame. How can I store this trail then?
But then if I do that, wouldn't the game become very slow, having to draw so much, after having moved all over the screen?
Is there way to not have the draw function wipe the screen, and instead just 'add' the current position o the circle instead? That seems like it would be a lot easier and faster.
Thanks!