www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/05/12:14:22

Message-ID: <38C28D93.1457A457@hotmail.com>
From: Dan Nicoletti <dan_nicoletti AT hotmail DOT com>
X-Mailer: Mozilla 4.7 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Please help - Allegro/Sprites Question.
Lines: 34
Date: Sun, 05 Mar 2000 16:40:48 GMT
NNTP-Posting-Host: 209.245.136.249
X-Complaints-To: abuse AT earthlink DOT net
X-Trace: newsread2.prod.itd.earthlink.net 952274448 209.245.136.249 (Sun, 05 Mar 2000 08:40:48 PST)
NNTP-Posting-Date: Sun, 05 Mar 2000 08:40:48 PST
Organization: EarthLink Inc. -- http://www.EarthLink.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello,
I have recently jumped into learning about sprites and have hit a bit of

a roadblock with my code.  My C book isn't much help and I am not
sure where to look next. Here's the problem.

My sprite structure is like this declared in my game.h file.

typedef struct _sprite
{
  ... some variables...
 BITMAP *bitmap;
}SPRITE;

SPRITE *sprite[10];

In my main file I am initializing the bitmaps for each sprite from my
data file like this.

void sprite_init()
{
blit(file[0].dat,sprite[0]->bitmap,0,0,0,0,16,16);
blit(file[1].dat,sprite[1]->bitmap,0,0,0,0,16,16);
etc.
}

Problem: For some reason the second blit overwrites the
first one and I end up with the same sprite for each.
Can anyone offer assistance please?

Thanks!!
Dan N
dan_nicoletti AT hotmail DOT com

- Raw text -


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