Box2D Forums

It is currently Thu May 23, 2013 10:14 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: wck dynamic use
PostPosted: Sat Nov 13, 2010 1:12 pm 
Offline

Joined: Thu Mar 19, 2009 5:26 pm
Posts: 21
Hi there,
I am working on a game, and i think wck is great on to create level design, so designer can just create physics with an easy drag and drop. What i don't understand is how can i use this amazing tool with an FDT approach.
Let me explain it better.
I have my project set as an fdt project. So i load an external assets.swf where i create all my physics Tiles.
Problems start when i want to create some other physics objects pure in code. So for example i want to create a BoxMan directly by code. or even the World.
If i create the world using the component, reading the World in the applicationDomain of the assets.swf , where the component is part of the library, there is no problem. but if i do that
Code:
world = new MyWorld() ;
world.name = 'world' ;
addChild( world ) ;

i just get errors on all the Box i am attaching from library
cannot convert Box2DAS.Dynamics::b2Body@132d8141 to Box2DAS.Dynamics.b2Body

any idea what could be the best approach? i would like to keep my FDT approach, instead of using the Flash IDE

Hope everything is clear

Cheers


Top
 Profile  
 
 Post subject: Re: wck dynamic use
PostPosted: Sun Nov 14, 2010 4:56 am 
Offline

Joined: Thu Mar 19, 2009 5:26 pm
Posts: 21
actually i managed to make that working. basically i have to create everything, even the Box, by code. This means that, solution for level design could be that the designer can just drag some box on the Tile, and with code i can read these positions and widht and height, and i can create a Box component, giving it a shape with these details.
Just not sure if this is the best approach in performance.
I mean
create a box to make walls as
Code:
var box : Box = new Box()
world.addChild( box )

is the same ( in term of performance ) as create this directly in box2d ( that means create a b2body, b2BodyDef , set userData etc )?


Top
 Profile  
 
 Post subject: Re: wck dynamic use
PostPosted: Sun Nov 14, 2010 1:49 pm 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
I'm not sure how this can work. I think what is happening is the library is being included twice, once in FDT and once in the SWF from Flash. The same issue I think would happen if you use Flex (Flash Builder). I've thought about this but haven't really come up with a solution. What I do is edit code in a different editor (BBEdit) but compile with Flash.

You could always use the core Alchemy port alone and roll your own framework, which seems the direction your second post is going.


Top
 Profile  
 
 Post subject: Re: wck dynamic use
PostPosted: Sun Nov 14, 2010 3:44 pm 
Offline

Joined: Thu Mar 19, 2009 5:26 pm
Posts: 21
hey, thanks for your reply.
I'll keep update this post about my tests, because the second approach is giving me other troubles,as not getting all the physics on some box... i'll explain better once i'll complete a set of tests.


Top
 Profile  
 
 Post subject: Re: wck dynamic use
PostPosted: Tue Nov 16, 2010 2:52 am 
Offline

Joined: Thu Mar 19, 2009 5:26 pm
Posts: 21
cool, all works fine :)
I create everything from code, but still using World, Box, Arc classes, that save me a lot of time.

Cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 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