delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/09/21:00:58

From: arganoid AT fatal-design DOT com (Andrew R. Gillett)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: making a snake grow
Date: Sun, 10 Jan 1999 01:48:54 -0000
Organization: www.release-dates.co.uk
Lines: 22
Message-ID: <MPG.110217611adc5d6d98a054@news.freeserve.net>
References: <369767d4 DOT 18850738 AT news DOT freeserve DOT co DOT uk> <MPG DOT 110188dcd34af60a98a03c AT news DOT freeserve DOT net> <3697f0bf DOT 6123846 AT news DOT w-link DOT net>
NNTP-Posting-Host: modem-107.tellurium.dialup.pol.co.uk
X-Trace: news7.svr.pol.co.uk 915932937 32051 62.136.25.235 (10 Jan 1999 01:48:57 GMT)
NNTP-Posting-Date: 10 Jan 1999 01:48:57 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: MicroPlanet Gravity v2.10
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In comp.os.msdos.djgpp, pjotr wrote:
> On Sat, 9 Jan 1999 16:31:34 -0000, arganoid AT fatal-design DOT com (Andrew
> R. Gillett) wrote:
> 
> >In comp.os.msdos.djgpp, Ben Dowling wrote:
> >> I am writing a game called wormies, it is a snake
> >> clone, but I don't know how to make the snake
> >> grow! Could any one help me?
> >
> >How far have you got with the game so far? Presumably you must have a 
> >variable which contains the length of the snake, otherwise how do you 
> >know how much snake to draw on the screen?
> 
> Wouldn't a simple array be sufficient? where snakepos[0] holds the
> snake's head position and snakepos[length_of_snake] holds the tail.

Good idea. If I was going to write a snake game, that's how I'd do it.

-- 
Andrew Gillett       http://argnet.fatal-design.com/      ICQ: See homepage
You will meet a tall dark stranger. Unfortunately he's holding a large gun.
Run for it!

- Raw text -


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