snake game w/ the box2d physics

Show off your games, demos and other (playable) creations.
Post Reply
monkyyy
Citizen
Posts: 52
Joined: Fri Mar 16, 2012 5:29 pm

snake game w/ the box2d physics

Post by monkyyy »

after giving up on finding a ragdoll lib that i could port from box2d (and a long time to find motivation >__>), here is the code after i was done playing w/ it, to learn how to use the physics in love. its very very ugly, but maybe it will help someone as there isnt to much more then the small page on the wiki for learning it
Attachments
snake_physics.love
version 9001?
(5.01 KiB) Downloaded 211 times
Last edited by monkyyy on Wed Mar 28, 2012 3:45 am, edited 2 times in total.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: snake game w/ the box2d physics

Post by Tesselode »

This is actually kind of fun. Make sure the snake doesn't get frozen when it exits the screen, though.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: snake game w/ the box2d physics

Post by Lafolie »

There's plenty of Box2D resources around, it seems to be pretty popular. Have you read any of this?
http://box2d.org/manual.pdf

Fix the freeze-ups, I wanna play about with this incredibly sensitive snake. :huh:
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.
User avatar
tsturzl
Party member
Posts: 161
Joined: Fri Apr 08, 2011 3:24 am

Re: snake game w/ the box2d physics

Post by tsturzl »

Lafolie wrote:There's plenty of Box2D resources around, it seems to be pretty popular. Have you read any of this?
http://box2d.org/manual.pdf

Fix the freeze-ups, I wanna play about with this incredibly sensitive snake. :huh:
https://love2d.org/wiki/Body:isFrozen

Bodies are frozen when they exit the world. There's not function in love.physics to unfreeze a body, I believe you have to put the body back into the world.
monkyyy
Citizen
Posts: 52
Joined: Fri Mar 16, 2012 5:29 pm

Re: snake game w/ the box2d physics

Post by monkyyy »

some how i lost motivation again(somehow ^__^") and just abused the physics engine some more
holding down "n" will cause some bugs to appear including the snake exploding then reforming, or it crashing

@tess it now has walls

@lafo i was talking about love not box2d, although im not sure how closely they are related :/
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests