delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/09/20:00:23

From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp,rec.games.programmer
Subject: Re: HELP: pixel finder algorithm ??
Date: Sun, 09 Aug 1998 20:47:19 -0300
Organization: NBTel Internet
Lines: 21
Message-ID: <35CE3506.5F2F66DD@unb.ca>
References: <35CE0D3C DOT 63BA AT cam DOT org>
NNTP-Posting-Host: fctnts10c73.nbnet.nb.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Vic wrote:

> I thought of using sor of a height map for the bitmap, since all zeroes
> in the bitmap mean there's nothing there, I could find out the height of
> the next pixel, closest to the worm and decide from that wether the worm
> can climb it or not, but the landscape can have "holes" in it.
> this is a similar thing to scorched earth and all games like that, but
> where you can move on the land.

     Using the height map would very likely be a good idea.  If there are
holes, then just make the height -1 or something.  And if the character
wants to move 1 pixel, check to see if the difference in height is <=1, if
so, let it move and adjust it's 'y' position.

--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT GeoCities DOT com
          Endlis AT nbnet DOT nb DOT ca


- Raw text -


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