Page 1 of 1

I need help makeing a snake game

Posted: Sat Sep 07, 2013 7:12 pm
by get52
II just did a pong clone and gridlocked player and hampster ball so now...I'm lost I dont know what to do next but I thought snake but i have no idea how to make one :( plz help :awesome: -get52

Re: I cant find any good snake tutorials...

Posted: Sat Sep 07, 2013 7:28 pm
by Eamonn
I actually don't know how to make snake, but if anyone knows how, let me know too!!!!!! :D

Re: I cant find any good snake tutorials...

Posted: Sat Sep 07, 2013 7:37 pm
by veethree
It's kinda like the gridlocked player, But instead of making a gridlocked player, You make a snake game.

I've made a few snake clones in my time, I've attached one of them so you guys can look at the code if you want to. It only has the snake and it's basic functions.

Re: I cant find any good snake tutorials...

Posted: Sat Sep 07, 2013 8:00 pm
by raidho36
You won't get far if you're gonna solely rely on tutorials. You need to do some programming research instead.

Re: I cant find any good snake tutorials...

Posted: Sat Sep 07, 2013 11:36 pm
by Roland_Yonaba
get52 wrote:II just did a pong clone and gridlocked player and hampster ball so now...I'm lost I dont know what to do next but I thought snake but i have no idea how to make one :( plz help :awesome: -get52
Actually, there is a difference between what you are saying, and the topic title.
I can't find any good tutorials.
Well, what tutorials have you found, yet ? Have you tried - at least - a minimal implementation ?
What went wrong ? Giving us a few more details would help to give you more pointers.
Unless the question is : "How can I make a snake game" ?

Re: I cant find any good snake tutorials...

Posted: Sat Sep 07, 2013 11:48 pm
by Eamonn
Well, this helped me a lot. Thanks Veethree!

Hopefully the example helps you. I have a lot of tutorials ready to upload over the next 2-3 months(along with some other videos), so when that's done I might PM you :)

Good luck! Definatly check out Veethree's example, and hopefully that helps you.

Yes, do give more information. For me, I failed because I didn't understand how to gridlock and how to add to the tail.

Re: I cant find any good snake tutorials...

Posted: Sun Sep 08, 2013 2:10 pm
by get52
Eamonn wrote:Well, this helped me a lot. Thanks Veethree!

Hopefully the example helps you. I have a lot of tutorials ready to upload over the next 2-3 months(along with some other videos), so when that's done I might PM you :)

Good luck! Definatly check out Veethree's example, and hopefully that helps you.

Yes, do give more information. For me, I failed because I didn't understand how to gridlock and how to add to the tail.
Yeah, I have the gridlocked player setup but I dont know how to make it so when i press 'right' for example to keep it going right it only happens once witch is not what i want i want it to go forever if that makes sence...for example :x wow shit i cant spell for shit today ._.

Re: I cant find any good snake tutorials...

Posted: Sun Sep 08, 2013 2:12 pm
by get52
raidho36 wrote:You won't get far if you're gonna solely rely on tutorials. You need to do some programming research instead.
All i need is help with a couple things the tutorial would just help me figure it out ._.

Re: I cant find any good snake tutorials...

Posted: Sun Sep 08, 2013 5:53 pm
by raidho36
get52 wrote:
raidho36 wrote:You won't get far if you're gonna solely rely on tutorials. You need to do some programming research instead.
All i need is help with a couple things the tutorial would just help me figure it out ._.
See, this is just it. Instead of thinking and inventing a snake game, you're looking for a premade solution that you can apply nearly directly with minimum thinking effort.

How do you make a snake game? Remember brick game handhelds? It had a grid display. Essentially, it was directly displaying a 2d-array in the memory. So your map is 2d-array (a table of tables), and you put your pieces into it, and then just render it "as is". When the snake head takes a turn, it puts a piece in front of itself and then, head position is marked as that piece's position. And so forth. When you press directional buttons, you alter snake head's direction. Before you go further, you check if you can actually go to the next cell or if there's a food piece. You should also keep record of which direction the head moved afterwards, so that your can know to which direction you remove tail pieces. And when snake consumes the food, it's length simply extended and the tail doesn't move until it's actual length matches grown length.

Start off with making an empty 2d-grid. Then, decide how will you record your pieces in. It can be as simple as writing their names to the table cells, like map[x][y] = "snake up" (the latter word is the direction where the head went). Keep track of the head and tail by having their X and Y coordinates as a variables. Also, remember snake's actual and grown length the same way. Every, say, 100 update function calls, make snake's head place a new piece to the grid and remove last tail piece, and update coordinates of both, but before snake can go, check it against collisions using the grid. And so on. Just think about it. Game development is a big time inventing and re-inventing deal, unless you can master it you can never get really good at it.

Re: I cant find any good snake tutorials...

Posted: Thu Sep 12, 2013 12:12 pm
by get52
veethree wrote:It's kinda like the gridlocked player, But instead of making a gridlocked player, You make a snake game.

I've made a few snake clones in my time, I've attached one of them so you guys can look at the code if you want to. It only has the snake and it's basic functions.
Thank you from your help and that eeamond hopefully thats how you spell it...I've used a peek at your code and eamonds help and I've figured out my own way :) thx