Hi,
In my game I use a scrolling method, which moves the background whenever the actor should be moved, which looks like a scrolling world. The problem is that my background is repainted in every frame, which is why the application throws the Out.Of.Memory.Error (or at least I think that's the reason). I simply haven't figured out how to delete the previous background image before the new one is painted. I would be grateful for some advice.
cX and cY are the coordinates where the new background is drawn.
Thanks.
1 2 3 4 5 | public void scrolllevel( int cX, int cY) { getBackground().clear(); getBackground().drawImage(background,cX- 500 , cY- 250 ); } |