Skip to main content

News

Topic: box2d-sphere (Read 211 times) previous topic - next topic

box2d-sphere
I've been working off and on on a port of box2d.js to miniSphere, which would allow a developer working with miniSphere to make more dynamic platformers. If you aren't familiar with box2d, it's a physics engine used in games like Angry Birds, LIMBO, and Happy Wheels.
The screenshot shows the stage in "Debug draw" mode, which would be the equivalent of drawing only collision objects in miniSphere. When it's more stable, I would be able to attach a Person object's position and rotation to a box2d object.
Unlike box2d.js and the original, I'm also working on a stage object to make stage building easier. So rather than writing boilerplate code for each static and dynamic body, you can just create a JSON file and save a lot of effort. For example, this is the file that sets up the stage shown in the screenshot:
Code: [Select]
{
"name": "Test stage",
"gravity": { "x": 0, "y": 32 },
"allowSleep": true,
"border": {
"top": 5,
"bottom": 5,
"left": 5,
"right": 5
},
"objects": [
{
"type": "rectangle",
"dynamic": false,
"position": { "x": 32, "y": 32},
"size": { "w": 50, "h": 10},
"angle": 5
},
{
"type": "circle",
"dynamic": true,
"position": { "x": 55, "y": 64},
"radius": 10,
"angle": 0
}
]
}


I wanted to make an animated GIF showing it in action, but OBS studio wouldn't play nicely.
This is a somewhat low-priority project compared to the other ones, but I figure you guys might be interested. I'm going to hold off on uploading the code, since it's a bit of a mess right now. As soon as it's at least a little bit more stable, I'll probably upload it to GitHub or something.
  • Last Edit: September 24, 2017, 09:17:51 pm by Eggbertx

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: box2d-sphere
Reply #1
This is nice! I want to create a platformer in miniSphere eventually, so this would come in mighty useful. :)

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: box2d-sphere
Reply #2
Nice!  miniSphere 5.0 will make this kind of thing more practical too, thanks to Chakra's blazing-fast performance.

I spotted that SSj Blue badge in your screenshot.  I imagine you might have leaned on the debugger a lot while developing something like this! ;)
miniSphere 5.0.1 - Cell compiler - SSj debugger - thread | on GitHub
For the sake of our continued health I very much hope that Fat Cerberus does not become skilled enough at whatever arcane art it would require to cause computers to spawn enourmous man eating pigs ~Rhuan

Re: box2d-sphere
Reply #3
This is nice! I want to create a platformer in miniSphere eventually, so this would come in mighty useful. :)
That was what I had in mind. I've had an idea for a while now for a game with similar gameplay to Abuse, using this.

Nice!  miniSphere 5.0 will make this kind of thing more practical too, thanks to Chakra's blazing-fast performance.
I figured that was the case. It runs decently with Duktape, but I'm definitely looking forward to ChakraCore.
I spotted that SSj Blue badge in your screenshot.  I imagine you might have leaned on the debugger a lot while developing something like this! ;)
Actually, I was just frustrated with OBS, so I just pressed F5. I do usually make decent use of SSJ, but I haven't used it much with box2d-sphere.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: box2d-sphere
Reply #4
@Eggbertx Have you tried it on the 5.0 beta at all?  Beta 2 is fairly stable, there might be a glitch here and there but it should run pretty well.  For the next beta I should probably have it install in a different location so that people can use 4.8.x and the 5.0 beta side-by-side.
miniSphere 5.0.1 - Cell compiler - SSj debugger - thread | on GitHub
For the sake of our continued health I very much hope that Fat Cerberus does not become skilled enough at whatever arcane art it would require to cause computers to spawn enourmous man eating pigs ~Rhuan