-Chris
typdef struct sprite_typ
{
int x,y;
int state;
...
}
Steven Sensarn - txs5...@bayou.uh.edu
Use a separate list. This makes it about a million times easier to move all
enemies.
--
+------------------------------------------------------+
| "Fumbling in frustration, inside soul torn apart |
| Feel the loss of paradise, leave an empty heart |
| Closing eyes will shut out, the warm light of a life |
| Grip is fading slowly, for each day passing by" |
| - Desultory, "A Closing Eye" |
+------------------------------------------------------+
| Rainer Deyke (rai...@mdddhd.fc.hp.com) |
+------------------------------------------------------+
>Hello I have a question about how to implement monsters in a 2d
>tile-based game like gauntlet...Is it best to have the enemies stored as
>tiles and when they appear on screen treat them as sprites or simply to
>have a seperate list of all monster positions in a seperate data
>structure?
>-Chris
It really depends on the density of the enemies. Just my personal
experience though I would recommend using a list of enemies. Possibly
even a two list structure where you keep enemies within a certain
range on the active list and enemies farther out in another.
Having a list structure for the enemies also allows you to avoid the
problem of having to search ALL the cells in your world every time you
go through a game loop and want to action all the enemies.
allen