Sign in to follow this  

Worm/Nibble style image bending

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this