Skip to main content
gamedev.net
🔒 Locked

Snake Clone

Started by Tech19 Jan 27, 2003 at 1:45 PM 2 replies 250+ views
Original Post
Tech19
Tech19
Im building a console snake clone & was wondering how I can keep track of all the tail segments coordinates and how i could move them ''forward'' so to speak as the player changes the direction that the snake is moving in. At the moment i''m only using one segment for the snake, so now i obviously need to add segments to it as it eats things. Any help appreciated
ToohrVyk
ToohrVyk
Use an array for the screen ( unsigned char * ), for the size, or (unsigned long * ) if you want 32 - bit faster read...

Mark some as empty, some as tail, some as head, some as body. In each body segment put the direction of the next body segment. Then, each update step, move the tail forward (erasing the previous position) using the directions given, and move the head forward (creating directions).

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.