Re: A89: Quick Redraw?
[Prev][Next][Index][Thread]
Re: A89: Quick Redraw?
>In my newly released CraPong game, my current setup is that I'm clearing the
>screen with every cycle. This is extremely stupid and I admit it, but I can't
>find a reasonable way around it.
>
>One way I tried to fix it was by having two sets of vars for the ballx and
>bally. The first set was the real ball and the second was the coordinates in
>the previous cycle. Then I drew the ball at the real coordinates and erased
>it at the other. For the paddles, I drew/erased a line at each end of the
>paddle according to what direction the paddle was moving. Thus if you move up
>one pixel, I draw one line at the top and erase the line at the bottom. The
>only problem this way was that It created uneven slowdown, and the improvement
>of screen flickering was nonexistent.
>
>Does anyone have any suggestions?
If the ball and paddles only move one pixel at a time, you could use
sprites that are slightly larger then ball and padel.
0000000
0011100
0100010
0100010 7x7 ball sprite. The whitespace on the edges will
0100010 erase the previous ball in one cycle.
0011100
0000000
--Nate
References: