Lots and Lots of Slithery, Twisted Fun
Posted by Michael on 26 January 2004, 23:45 GMT
For those of you in an chordate mood, Reggie Tucker has updated Snake 2, intended to be a 83+ clone of the nibbles game found on many cell phones. It's still under development, and only the "New Game" feature is working in this v0.8 release.
But, if you have a 89, there's Mr Worm by Jean-Francois Geyelin, an expanded version of nibbles where your annelid friend can move in forty directions instead of the usual four. May the apple consuming commence!
|
|
Reply to this article
|
The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Lots and Lots of Slithery, Twisted Fun
|
Ben Cherry
(Web Page)
|
I had an idea a few months ago that i never tried out for a nibbles game. This would have to be done in C, because of pointers (unless ASM has pointers too). You make a 1D array, a list, out of characters, and it is twice the worm's length, an x and y value for each point. As the worm moves, you erase the last point, draw the new point, and then add the size of a character (1 byte?) to the pointer and then write the head's coordinates into the new spot. So in effect, your worm is a list, and that list actually snakes through the memory. Here's a visual, if it comes out right when i post:
______Block of memory______
|___|___|___| ___|___|___|___|
^the pointer to the start of the array points here
then the pointer is increased by one, so the viewing window of our 6 element array, for a 3-long worm, is shifted. Thus the old head becomes a part of the body, and the old tail is shifted away. The big problem if this would actually work at all is that this would be snaking its way through memory and probably start messing up protected memory. I doubt this would ever work, but its just an idea i had...
|
Reply to this comment
|
28 January 2004, 23:54 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Lots and Lots of Slithery, Twisted Fun
|
Chivo
|
Well, you can store four pointers instead of one to get a circular buffer: head and tail (heh, literally), and begin and end. head and tail are pretty obvious, I think. The begin and end pointers are the upper and lower bounds of the buffer.
When you put in a new coordinate for the head, store the (x,y) at head and increment it; if head matches end, then set head to begin. Similarly, do the same for tail, but get the (x,y) from tail instead of storing it.
By the way, ASM doesn't have pointers, exactly ("pointers" is a C concept). In ASM, a variable can hold the address of another variable or object, so you could call that variable a "pointer".
|
Reply to this comment
|
30 January 2004, 03:06 GMT
|
|
1 2 3
You can change the number of comments per page in Account Preferences.
|