Snake Game?
Ken110
Member Posts: 2
How would you go about creating a snake type game in GS? You know, when there is a ball that automatically moves and replicates every time you run over another randomly positioned different colored ball. You have to change the direction of the growing snake so you can collect the random ball and so you don't hit a wall or bump into yourself.
Any help would be greatly appreciated.
Any help would be greatly appreciated.
Comments
Now, in the tail bit:
if game.spawn is true and if "self.readytospawn" attribute is true, bit of tail spawn another bit of tail to x,y coordinates from it, and change self.readytospawn to false.
All the little bit spawn with that self attribute to true by default, in this case, and when they spawn another bit of the tail, they uncheck that attribute, so that only the last bit of the tail spawn.
Thing is, I need to think more for the movement. Making the snake head moving in the four direction is easy, I don't know about the bit of tails that must follow him.
Maybe, if when an arrow is pressed game.posX and game posY are changed with the x and y coordinates of the snake head and if you store in an attribute the key that was pressed, then you can make it so that when the little bits of the tails reach those coordinate, they change direction based on the key that was pressed.
This way, with the greater or less thing, it should always fire right.
I'll try when I have time, and I'll make a template. If it works xD
Iwas thinking of requesting that, it's great for platormer backgrounds
Yet the snake game is so played out, I got tired of it back in the 80s
Make something else! Like a centipede type game. Now that's entertainment
Could be a big challenge to write , NE one up to it?
As POLYGAMe said, it is funny how something that seems like it would be pretty simple ends up being a bit tougher than expected.
FranzKeller, I appreciate your suggestion to make something else although I am fairly new to gamesalad, I've always liked the Snake game and thought this would be a good practice game to start with. I wanted to do something a little different than the usual template games that come with GS.
RH, thank you for that link, that is pretty much what I'm trying to do.
And finally, Hachiko, thank you very much! I'm pretty sure I have a basic idea now of how to go about this, I will try it out in gamesalad soon. Also, I am looking forward to that template, hopefully it will work.