Posts
Search
Contact
Cookies
About
RSS

SpritePlacer get physics

Added 23 Sep 2014, 3:36 p.m. edited 19 Jun 2023, 3:29 a.m.

SpritePlacer

While far from complete, SpritePlacer now has physics. Each sprite can have multiple physics shapes added to it. This allows you to have sprites that aren’t rectangular. You can see an example of this on the left (click to enlarge), the dumbbell shapes each have three physics shapes. Two spheres and a rectangle are sufficient to make the collision shape for the sprite. In addition to the collision shapes (and properties like restitution friction and density) its also possible to have different body types, as well as static and dynamic bodies you can have kinematic bodies. While there isn't much use for kinematic bodies at the moment they might be quite useful once I've implemented scripting. There is a bunch of stuff still to implement physics wise and I'll be resetting sprite positions once the editor is put back into edit mode after "running" the physics. While I initially just wanted a way to place a bunch of sprites in a "level", by the time I've added physics and scripting I'll have in effect a 2d game creator. I'm not sure just yet what events to support (collision, level loaded etc) but its funny how a simple project can gradually evolve into something else altogether!