Mail Archives: djgpp/2000/01/16/16:39:05
Matt Huston wrote:
>
> Okay, I have two pong paddles that move accross the screen. They move and
> all ,but leave a smeere accross
> the screen. They are 150x25x8 bit BITMAPs in a datafile. You may find this
> code useful in helping me.
>
> Thanks,
> M. Huston
>
> ////////////////////////////////////////////////////
>
> void draw_pong()
> {
> draw_sprite(BUFFER, GAMEDATA[BMPPONG1].dat, pong1_x, pong1_y);
> draw_sprite(BUFFER, GAMEDATA[BMPPONG2].dat, pong2_x, pong2_y);
>
> blit(BUFFER,screen,0,0,0,0,640,480);
> // vsync(); //It made the paddles move slower so I left it out
> }
You forgot to clear the buffer....
you can put it in like below:
void draw_pong()
{
clear(BUFFER);
draw_sprite(BUFFER, GAMEDATA[BMPPONG1].dat, pong1_x, pong1_y);
draw_sprite(BUFFER, GAMEDATA[BMPPONG2].dat, pong2_x, pong2_y);
draw_any_thing_else_that_needs_to_be_drawn();
blit(BUFFER,screen,0,0,0,0,640,480);
}
--
|"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
| `.`/""""""\,',' my sig is too big, |
|SEE HIS ( / \ \' SEE HIS but its really cool. |
| FACE \/<> <>\/ SMILE |
| / W \ Visit my ascii art site: |
| ,'\_|||||_/`. http://www.gtcom.net/~krogg/ascii/ |
| ,',' ||| `.`. krogg DOT no DOT to DOT spam AT gtcom DOT net |
|____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|
- Raw text -