• ### Popular Now

• 13
• 12
• 9
• 10
• 13

#### Archived

This topic is now archived and is closed to further replies.

# Trails

This topic is 5696 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Now I know trails are a simple thing to fix, just usually clearing a screen, but this is not the standard clear screen issue. I have a tile engine up and running. I just started the NPC movement routines, and I''m getting trails. I don''t redraw the map every frame, because it slows the game down a lot. So it refreshes the map every 7 frames. During those periods that the map isn''t being redrawn, there are trails behind the NPC''s, because, of course, the map isn''t being redrawn every frame. I thought about redrawing a 4x4 box of tiles around the character everytime he moves. Then I thought to just draw the opposite direction you are walking, so it won''t sacrifice as much speed (not very noticable, but I need every frame I can get ). But if another NPC moves in the area that it redraws, then it''ll temporarily disappear. Any suggestions? PS: I am using Allegro 4.0

##### Share on other sites
If you are currently implementing it like this:

for each character clear old sprite draw new sprite

Change it to this way instead:

for each character clear old spritefor each character draw new sprite