simple snake

Show off your games, demos and other (playable) creations.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

simple snake

Post by bmzz »

This is my first LOVE game. A simple snake game.

controls:
Up, down, left and right arrow keys.
Pause is 'p'.
If you died, press 'Enter' to restart.

Download

Enjoy.
Attachments
snake.png
snake.png (29.45 KiB) Viewed 6093 times
Last edited by bmzz on Sat May 07, 2011 1:31 am, edited 4 times in total.
User avatar
knorke
Party member
Posts: 239
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: simple snake

Post by knorke »

worked nicely.
but after dying it should maybe still display the score?
now to make it a real game with levels, multiplayer and all that ;)
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: simple snake

Post by Lafolie »

This is awesome. Well done.

It's an amazing example of the kind of thing new Löve developers should be doing for their first project. Just brilliant. It seems to cover all the basics including drawing primitives, text, using colour, updating, taking input and it's even got a little highscore tracking system. Fantastic man.

My criticism would be that the player seems to move a bit too slowly.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

Re: simple snake

Post by bmzz »

Hi knorke,

you are right, i should always show the score. I have modified snake.love for it.
Thank you for your idea, i will think about them.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

Re: simple snake

Post by bmzz »

Hi Lafolie,

I am greatly flattered by your evaluation.I just a LOVE/lua newbie...

Anyway, Thank you very much.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: simple snake

Post by bartbes »

Yeah, I agree with Lafolie on the speed, I didn't really get far in the game, though I spent a good 2 minutes playing it, making it faster should make it more fun.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

Re: simple snake

Post by bmzz »

i'm have no idea about speed.

i adjust speed from 0.04(sec per block) to 0.02, maybe it will be better.0.015 is the fastest on my pc.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: simple snake

Post by Lafolie »

bmzz wrote:i'm have no idea about speed.

i adjust speed from 0.04(sec per block) to 0.02, maybe it will be better.0.015 is the fastest on my pc.
You use the value dt which is passed down through love.update. Basically, you should do:

Code: Select all

time_based_value * dt
I took the time to edit your code and implement dt rather than the manual os.time() comparison you were making. The result is much smoother. If you want to adjust the speed, do so moderately, using small values, e.g. speed = 2 will be slightly slower, speed = 0.5 will be slightly faster. I personally feel that 0.75 - 1 work quite well.

I also added a conf.lua based on your current setup and changed the window size. I felt that the speed of the snake (even updated) was too low to justify such a huge window. Unless you have a huuuuge score you may have to travel an extreme distance, which isn't much fun. I used conf.lua to specify the window dimensions and adjusted your code to read the window size.

Oh, and I added in a little surprise. I have a good reason for doing that, but I hope it helps introduce you to another Löve module. :nyu:
Attachments
snake_dt_audio.love
(536.66 KiB) Downloaded 543 times
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

Re: simple snake

Post by bmzz »

Lafolie wrote:
bmzz wrote:i'm have no idea about speed.

i adjust speed from 0.04(sec per block) to 0.02, maybe it will be better.0.015 is the fastest on my pc.
You use the value dt which is passed down through love.update. Basically, you should do:

Code: Select all

time_based_value * dt
I took the time to edit your code and implement dt rather than the manual os.time() comparison you were making. The result is much smoother. If you want to adjust the speed, do so moderately, using small values, e.g. speed = 2 will be slightly slower, speed = 0.5 will be slightly faster. I personally feel that 0.75 - 1 work quite well.

I also added a conf.lua based on your current setup and changed the window size. I felt that the speed of the snake (even updated) was too low to justify such a huge window. Unless you have a huuuuge score you may have to travel an extreme distance, which isn't much fun. I used conf.lua to specify the window dimensions and adjusted your code to read the window size.

Oh, and I added in a little surprise. I have a good reason for doing that, but I hope it helps introduce you to another Löve module. :nyu:
Thank you.

I learned a lot from you. =)
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: simple snake

Post by Lafolie »

It's cool man. I learned some stuff from your code too man. 's all good! :neko:
Hate to say but that's what the rep button is for, heh.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Post Reply

Who is online

Users browsing this forum: No registered users and 204 guests