www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/15/18:14:02

Message-ID: <002901bdb03d$955c7500$784e08c3@arthur>
Reply-To: "Arthur" <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>
Subject: Re: Sprite "ghost" help please.
Date: Wed, 15 Jul 1998 23:11:49 +0100
MIME-Version: 1.0

>I'm slowly learning to write my first game.
>I have a sprite that moves horizontally across the screen controlled by the
>keyboard.
>
>Am using Allegro, with a 640x480 screen, and page flipping.
>The problem is that when the ship moves, I can see it 'flickering' at the
>edges.
>Is there any way to fix this?


You are using two "screens" do draw sprites. It may seem a stupid question,
but are you drawing and erasing the same sprites from the same screen each
loop. It happens. Also, are you checking for a vertical blank before you
swap the screens?

The correct order (although this can vary depending on what graphics mode
you're in or what graphics card you have) is:

1) erase old sprites on hidden screen.
2) draw new sprites on hidden screen.
3) wail for vertical retrace.
4) swap screens.


HTH

James Arthur
jaa AT arfa DOT clara DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019