PDA

View Full Version : PlayKode D6


beepy
2007.11.02, 02:02 PM
PlayKode D5 (which I didn't post about here) accidentally expired so here is the non-expiring D6:

> PlayKode D6 (http://www.biggerplanet.com/download/PlayKode.app.zip)

It includes a partial integration of the excellent Chipmunk Physics engine, but not the most recent version. I'll reply to this thread with links to some physics examples later.

There are some other (non-physics) simple example projects on the PlayKode page of my site:

> biggerplanet.com/playkode (http://www.biggerplanet.com/playkode)

PlayKode is a fun, easy-to-learn programming environment for hobbyists, kids, or anyone interested in programming games or toys. It is designed to make real programming as approachable and rewarding as possible.

beepy
2007.11.02, 06:26 PM
You can download a pair of physics examples here (http://biggerplanet.com/download/physics%20examples%20for%20PlayKode.zip).

The "joint physics example" project is less interesting to look at but is commented and might serve as a better example at how to use the physics engine.

In a nutshell, you create a space:

space = physics2D.new(0, -.1)


and add bodies to it:

aBody = space:newBody{
mass = 1,
position = { x = 100, y =100},
shapes = {
{
type = physics2D.polygon,
definesMomentOfInertia = true,
elasticity = 0,
friction = 0.9,
vertices = { -10, 10, 10, 5, 10, -10, -10, -10},
}
},
}

then step the space forward:
space:step()


You can get the current position of a body for drawing, or whatever reason:
x, y, angle = aBody:state()


There's more, but those are the basics.

AndyKorth
2007.11.02, 07:00 PM
Ooh, this is really nifty! Nice work! The UI seems really well done and easy to use.