I need help makeing a snake game

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
get52
Prole
Posts: 36
Joined: Wed Sep 04, 2013 1:53 pm

I need help makeing a snake game

Post 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
Last edited by get52 on Sun Sep 08, 2013 2:12 pm, edited 1 time in total.
Only douchebags tell the admins to delete threads once they get they're answer. :awesome:
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

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

Post by Eamonn »

I actually don't know how to make snake, but if anyone knows how, let me know too!!!!!! :D
"In those quiet moments, you come into my mind" - Liam Reilly
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

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

Post 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.
Attachments
snake.love
(2.65 KiB) Downloaded 222 times
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post by raidho36 »

You won't get far if you're gonna solely rely on tutorials. You need to do some programming research instead.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

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

Post 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" ?
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

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

Post 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.
"In those quiet moments, you come into my mind" - Liam Reilly
get52
Prole
Posts: 36
Joined: Wed Sep 04, 2013 1:53 pm

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

Post 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 ._.
Only douchebags tell the admins to delete threads once they get they're answer. :awesome:
get52
Prole
Posts: 36
Joined: Wed Sep 04, 2013 1:53 pm

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

Post 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 ._.
Only douchebags tell the admins to delete threads once they get they're answer. :awesome:
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post 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.
get52
Prole
Posts: 36
Joined: Wed Sep 04, 2013 1:53 pm

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

Post 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
Only douchebags tell the admins to delete threads once they get they're answer. :awesome:
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests