Box2D Forums

It is currently Wed May 22, 2013 2:23 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Apr 24, 2011 4:44 pm 
Offline

Joined: Mon Mar 03, 2008 4:38 pm
Posts: 127
Location: Scotland
Ok this might not make any sense, but here goes!

What strategy do you use for organising your projects?

I am kind of stuck in Main.as

For example, imagine a bike. A bike is made up of multiple bodies and joints. Psudo:

Main.as

var world:world
var bikeBody
var leftWheel
var rightWheel
var leftAxel
var rightAxel

This is already a nightmare. But what i really want to be able to do is say:

Main.as

var world:World
var bike:Bike

Where bikes functionality is self contained and contains the leftWheel rightWheel...... properties.

Im seriously mixed up between the logical side of Box2d, and the visual side of WCK as to how best to structure functionality into reusable classes.

Apart from this, im really loving WCK! :D


Top
 Profile  
 
PostPosted: Mon Apr 25, 2011 9:13 am 
Offline

Joined: Tue Nov 09, 2010 1:26 am
Posts: 92
I would personally use a combination of pieces in the editor, and if you need them to have code behind the pieces, make the base class of that library object the corresponding class you've created.

I think it's easier if you know what your bike is going to look like to build the associations in the Flash IDE, using wck pieces, joints, and the like and hook in whatever code you would need in tandem with that as you see fit. I have traditionally avoided the Flash IDE for anything that would be code dependent, but WCK has warmed my heart a bit to the idea. It can save a ton of time over trying to do things solely in code when the visual/interactive benefits of WCK help you do things quickly.

Hope that helps at all. I was up all last night save a 2 hour nap, so I'm running on coffee alone


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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