Worm/Nibble style image bending

Started by
1 comment, last by raptorstrike 19 years, 6 months ago
ok im working on mock "Worm/Nibble" game (the game were you go around eating the apple and trying not to hit yourself or walls) any way i have no idea how to set up an entity that checks collision with it self and bends and gets longer with every apple like the worm dose. should this be lots of seprate squares following each other? thanks for the help [smile]
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
Advertisement
Quote:Original post by raptorstrike
ok im working on mock "Worm/Nibble" game (the game were you go around eating the apple and trying not to hit yourself or walls) any way i have no idea how to set up an entity that checks collision with it self and bends and gets longer with every apple like the worm dose. should this be lots of seprate squares following each other?
thanks for the help [smile]


The simplest way is to just create a tile based world, a tile can either be empty, filled with the apple or filled with the snake. If a tile is filled with the snake and you try moving to it then well crash, game over. That should be real simple for collision detection.

Maybe keep a linked list of the snake tiles and just remove from the end and insert into the beginning (check direction where to insert, then check if something is on the tile already, or if you are going off the map).

HTH
thanks i was thinking about doing somthing like that because there is not really a good way to add or take away or bend an entity in 2d (3d is a diffrent story)
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie

This topic is closed to new replies.

Advertisement