Page 1 of 1

snake game w/ the box2d physics

Posted: Mon Mar 26, 2012 1:33 am
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

Re: snake game w/ the box2d physics

Posted: Mon Mar 26, 2012 1:38 am
by Tesselode
This is actually kind of fun. Make sure the snake doesn't get frozen when it exits the screen, though.

Re: snake game w/ the box2d physics

Posted: Mon Mar 26, 2012 9:00 pm
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:

Re: snake game w/ the box2d physics

Posted: Mon Mar 26, 2012 11:54 pm
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.

Re: snake game w/ the box2d physics

Posted: Wed Mar 28, 2012 3:42 am
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 :/