Box2D Forums

It is currently Sun May 19, 2013 12:50 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Box2d Level Editor
PostPosted: Fri Aug 06, 2010 3:53 am 
Offline

Joined: Fri Aug 06, 2010 3:43 am
Posts: 10
Hi guys,
I made a box2d level editor. You can find it here:http://www.jacobschatz.com/bisonkick
Let it load.
I made it in Flex for Actionscript3 users. I want C++ programmers to be able to use it as well.
It currently outputs an actionscript3 multidimensional array of info:
Code:
//order: x , y , height, width, rotation, isDynamic, shape, friction,density,restitution,ID
 var map:Array = [
[259,408,50,302,0,false,'SQUARE' , 0.5,0.5,0.5,'iq']
,[205,232,50,50,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
,[279,230,50,50,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
,[247,318,50,50,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
];

What would be the C++ equivalent of this array?
Also in it's current state would it work for C++ programmers or does something need to change?
I know that the flash version of box2d has registration points for the shapes in the center.. Is this true for C++ as well?


Top
 Profile  
 
 Post subject: Re: Box2d Level Editor
PostPosted: Fri Aug 06, 2010 4:31 am 
Offline

Joined: Tue Jul 27, 2010 1:56 am
Posts: 22
hey it's great!
IMO you should add a field for additional info.
for example someone can store the sprite file name,
or other information for an element of a videogame but not strictly connected to the physics.

but it is still OK!


Top
 Profile  
 
PostPosted: Fri Aug 06, 2010 3:13 pm 
Offline

Joined: Fri Aug 06, 2010 3:43 am
Posts: 10
So is a multidimensional array the best way to send info to C++?
in Actionscript 3 I send this:
Code:
//order: x , y , height, width, rotation, isDynamic, shape, friction,density,restitution,ID
 var map:Array = [
[133,168,50,50,0.2801400450818924,false,'SQUARE' , 0.5,0.5,0.5,'iq']
,[224.2568878505796,124.18699926414965,50,50.000000000000014,0.5481100464052429,false,'SQUARE' , 0.5,0.5,0.5,'iq']
,[142.16923058555182,106.67653026016984,49.99999999999999,49.99999999999999,-0.1681296345455191,true,'SQUARE' , 0.5,0.5,0.5,'iq']
,[218,197,50,50,0,false,'CIRCLE' , 0.5,0.5,0.5,'iq']
,[243.5,83,98,101,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
];

And this is all different types of info. I know you can't really do that in C++ right?


Top
 Profile  
 
 Post subject: Re: Box2d Level Editor
PostPosted: Fri Aug 13, 2010 1:55 am 
Offline

Joined: Fri Aug 13, 2010 1:46 am
Posts: 1
Very good idea ! Currently I'm using Inkscape (an opensource SVG editor) as an editor and a custom Python script to generate a world description file (in JSON). Then in my C++ program I load the JSON file and create the box2d world accordingly.

The main problem with Inkscape, I need to affects some physics values to my svg elements, to do that I need to edit the XML file and add it by myself in comments or in a useless field. Then I copy/paste this elements from a "base" level that contains all my game elements to create a new level.

I would love to see this kind of editor whatever it generates. Do you plan to make it open source ?


Top
 Profile  
 
 Post subject: Re: Box2d Level Editor
PostPosted: Mon Sep 20, 2010 2:56 am 
Offline

Joined: Tue Jul 27, 2010 1:56 am
Posts: 22
Hi, a little bug:
(1) press play,
(2) during the simulation press the spacebar: simulation will restart
(3) click the "x" button to stop the simulation: it will not stop
(4) re-press "x": OK

I think it create a new simulation window for each spacebar is pressed, probably?


Top
 Profile  
 
PostPosted: Sat Nov 13, 2010 10:14 am 
Offline

Joined: Fri Aug 06, 2010 3:43 am
Posts: 10
I have updated my box2d editor a lot. goto http://www.jacobschatz.com/bisonkick
You now can create custom polygons and view live previews. Output as3 or xml. You can save your levels. And email your levels to others. output custom code. You should really check it out and let me know what you think.


Thanks,
Jacob
http://www.jacobschatz.com/bisonkick


Top
 Profile  
 
 Post subject: Re: Box2d Level Editor
PostPosted: Wed Jan 19, 2011 3:42 pm 
Offline

Joined: Fri Aug 06, 2010 3:43 am
Posts: 10
I have added joint attachment to my box2d editor. Please check it out. It is in Beta right now so I would love to know about all the bugs you find and any improvements you would like to see. I also made an easy to use API for Actionscript 3 so you can create your levels.
http://www.jacobschatz.com/bisonkick-beta
You can still use the original at
http://www.jacobschatz.com/bisonkick


Top
 Profile  
 
 Post subject: Re: Box2d Level Editor
PostPosted: Sun Feb 06, 2011 10:58 am 
Offline

Joined: Tue Jan 18, 2011 3:27 pm
Posts: 38
First of all, thanks for creating this level editor - it is very useful!

As future improvements I'd like to suggest the following: customizable gravity, ability to select all objects within a specified rectangle (instead of using "shift" and click), ability to move objects even when a "follower" object is specified and movable camera in live preview.

As for bugs, you probably shouldn't use "3" as a keyboard shortcut since it causes a problem when attempting to input values to textboxes. There's also a problem in the live preview which causes objects selection to be inaccurate - try to move a small object and you'll see what I mean.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group