keeping the background

BlitzMax Forums/BlitzMax Beginners Area/keeping the background

delusan(Posted 2007) [#1]
On a background i have drawn Image1 and Image2. Image1 fires a bullet at Image2 ... how do i keep from losing my background and the images when I move the bullet toward the target? When I use flip and cls in moving the bullet, i lose the background and images and end up with the object moving on a blank screen. Do I have to redraw the background and images everytime the object moves a step toward the target?


Perturbatio(Posted 2007) [#2]
you need to redraw the background every frame


JazzieB(Posted 2007) [#3]
Yes, you need to redraw everything each frame.

What most people do is put together a Render function, which basically redraws the entire scene, starting with the background, the level tiles, followed by the game sprites,


delusan(Posted 2007) [#4]
Thanks guys. Your help is greatly appreciated. I'll try to work it out fron there.


H&K(Posted 2007) [#5]
Depending on what type of game you are doing, instead of rendering directly to the screen, you could, make a new image, that has the same size os the screen, then you draw to that the more static things in the screen.

Then on frame update you draw that image first, then draw the less static things ontop.