[A83] Re: Monsters in smoothscroll game


[Prev][Next][Index][Thread]

[A83] Re: Monsters in smoothscroll game




> > You'd have to figure out another way to do it.
>
> A more sensible way would be using records for each
> monster. You only need to store its type, its location
> (maybe its velocity too) and probably some flags indicating
> its state. You can get all this into 8 bytes.
>
> Associating monsters and columns is a bit weird idea in my
> opinion...
>
> PG
>

Yes, but you have to realize that with an array, looking up a column or a
monster is as easy as an ADD.  With your idea, he would actually have to
loop through each record until he found the enemy he's looking for.  It
wouldn't be that bad if the records were sorted, but with large levels and
especially with multi-directional scrolling where the monsters would need to
be placed "back" onto the inactive records, it would quickly become
unsorted.

- - Joe

joe@joepnet.com




Follow-Ups: References: