[A83] Re: nibbles / snake


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

[A83] Re: nibbles / snake




> Don't give me immediately z80, but just the basic ideas,
> if you mind. I myself AM able to do some z80 asm, only
> these questions bother me. Perhaps there are more things
> I do not know, but those are for later...
I was a bit surprised when I read you post. Is it possible
that you couldn't come up with anything on your own 
regarding such a simple problem (considering your 
programming experience this is rather unbelievable), or you 
just wanted to know others' opinion? [This question is not 
meant to be offensive, just in case you interpret it that 
way. :]

Actually, Nibbles was my first program written for the 83, 
I used it to learn TI-BASIC. :) What I did to keep track of 
the nibble's movement was using a simple list that 
contained the directions (I think I used the numbers 
1,2,3,4 to distinguish between them) for each pixel of the 
nibble, and I moved a "pointer" over the list. When the 
nibble ate an apple, I stopped moving the pointer for some 
frames, so that it grew with some pixels in length. (Of 
course, the maximal length was 999 pixels.) And I used 
simple pixel testing to check collisions. If the pixel 
where the next piece was to be placed was already set, then 
I checked if it was the apple. If not, then poor nibble 
died...

Just a little extra advice: NEVER use XORed sprites! They 
look UGLY! :)

PG




References: