delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/18/00:33:01

From: Robin Burrows <rburrows AT bigfoot DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help: Allegro and animating...
Date: Sat, 18 Apr 1998 00:41:58 +0100
Organization: Virgin Net Usenet Service
Lines: 35
Message-ID: <3537E8C6.5A86@bigfoot.com>
References: <353788DC DOT F297ED77 AT sprynet DOT com> <6h8bf0$ik$1 AT orudios DOT magnet DOT at>
Reply-To: rburrows AT bigfoot DOT com
NNTP-Posting-Host: 194.168.72.89
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Elias Pschernig wrote:
> 
> >I've just barely gotten into animation
> >with Allegro.  I'm trying to animate a man
> >walking by over a rather intricate background
> >image.
> >
> >  If I don't erase the man after each frame,
> >he'll look like a solid streak across the
> >screen. (he's only advancing one pixel at a
> >time)  I can't just print a black spot where
> >the old frame used to be, because I'd lose
> >my background image.
> >
> >   I tried using create_sub_bitmap() to copy
> >the section of the background image that would
> >be changed, so I could print the "MAN" on the
> >screen, and clear him by using blit() like so:
> >
> >tempbmp=create_sub_bitmap(screen, x, y, 100, 100);
> >draw_sprite(screen, man, x, y);
> >vsync();
> >blit(temp, screen, 0, 0, x, y, 100, 100);
> >
> >   And then, I repeat the process, changing x and y
> >to move the image....
> >
> >   So, what'm I doing wrong?  Any assistance
> >would be greatly appreciated.
> >
> >Thank you.
> >Anthony A. Tedjamulia

I think it's worth pointing out that create_sub_bitmap doesn't make a
copy, it just allows you to use a different area of the original bitmap.

- Raw text -


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