Box2D Forums

It is currently Mon Sep 06, 2010 9:53 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 411 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13 ... 42  Next
Author Message
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Sun Feb 07, 2010 12:50 pm 
Offline

Joined: Mon Mar 03, 2008 4:38 pm
Posts: 118
hey.

I have been trying to get WCK to work for the past couple of weekends and i cant figure it out... im always getting errors.

What i have been trying to do is remove the whole Fla style system. What i mean by this, is so i can kick things off in Flex.

I am guessing that when the flash playhead gets to say... frame 2, then the equivalent of new World2() is called and then added to the display list. But how can i do this manually? I dont know how pressing the buttons to move from frame to frame is actually "kicking off" the worlds.

Code:
   
public class Demo extends WCK
{
     private var world1:World1
      
     public function Demo()
     {         
           super();   
               
           world1 = new World1();
           addChild(world1);
      }
}


This is a purely lame example to show an idea of what it is i am trying to do. Access to World1() is via exporting DEMO.Fla as a SWC otherwise the fla and its directory is identical.

If anyone could kick me off on this id appreciate it.

Cheers!


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Sun Feb 07, 2010 1:10 pm 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 494
Actually that should do the trick. The world is created when it is added to the stage - when it becomes visible. If the world is on the timeline (as in the demos) this happens automatically. Since you're doing it manually, "addChild(world1);" should trigger world creation. What errors are you getting?

BodyShape, Joint, World, etc. all extend Entity, which provides added-to / removed-from-stage creation / destruction triggers. This way you can forget about creation / destruction and just manipulate the display hierarchy.


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Sun Feb 07, 2010 1:52 pm 
Offline

Joined: Tue Feb 24, 2009 4:10 pm
Posts: 438
Location: Michigan
@MayoButter

One question before I get started.
I want to make sure WCK is OpenSource like box2d is.

Getting started:

I believe I can help with the documentation as I walk my self through the code to get acquainted.

Some improvements i would like to make.

wrap your code into com/sideroller
Including:
  • extras
  • gravity
  • misc
  • shapes
  • wck
  • (and maybe Box2DAS)

Box2D would obviously not be in that com structure

and demo, probe, and TestBed would better serve their purpose outside the com structure i believe.


<strike>I will also try to provide CS3 Demo's (I assume the only thing CS4 specific is the use of vectors?)</strike>
<edit> CS3 is not possible with WCK, no big deal i guess </edit>
And loading / use of external art assets.

I see from your code you use Inheritance heavily... I should be able to incorporate external assets into WCK seamlessly, but i will insist on using "Composition" (if i understand the terminology correctly) to pass the art in anonymously (if we were to require art assets to have linkage to their specific functionality they would need to be recompiled every time that functionality changes, to have the changes take effect, which becomes a mess)


also i think http://www.box2d.org/wiki would be a good place to do the documentation
as a branch off of the box2d wiki.

haven't asked Erin's opinion yet but I'm sure he will notice the link i added. and i linked that to this convo in case he has a problem with it. a bit rude of me i suppose.

<edit>
I would also like to be able to contact you more directly to speed up the documentation process
do you have an instant messenger i could contact you on?
</edit>


Last edited by sketchbookgames on Sun Feb 07, 2010 7:41 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Sun Feb 07, 2010 3:21 pm 
Offline

Joined: Mon Mar 03, 2008 4:38 pm
Posts: 118
Thanks for your quick reply Mayo mate.

I came back over to the work PC and it seems there must be an issue on my personal PC somewhere as the current setup works! :)

Excellent!

By the way Sketch, i thought that Alchemy was only supported by Flash Runtime 10? If you take away the vectors, wont it fail to compile anyway?

Nice work on the wiki.

Cheers.


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Sun Feb 07, 2010 3:39 pm 
Offline

Joined: Tue Feb 24, 2009 4:10 pm
Posts: 438
Location: Michigan
@clark Re: Alchemy needing flash player 10.
Good to know, thanks.


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Sun Feb 07, 2010 3:49 pm 
Offline

Joined: Mon Mar 03, 2008 4:38 pm
Posts: 118
Yeah mate just doubled checked because i didnt want to send you down a road based on a whim:

"The C/C++ code is compiled to ActionScript 3.0 as a SWF or SWC that runs on Adobe Flash Player 10 or Adobe AIR 1.5."


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Mon Feb 08, 2010 9:09 am 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 494
sketchbookgames wrote:
I want to make sure WCK is OpenSource like box2d is.

Same license as Box2D.
Quote:
wrap your code into com/sideroller

I've seen other packages organized this way. Personally I find the deep folder hierarchy extremely cumbersome. That, and when defining symbols in Flash it is nicer to type "shapes.Box" as the base class rather than "com.sideroller.shapes.Box".
Quote:
And loading / use of external art assets.

I see from your code you use Inheritance heavily... I should be able to incorporate external assets into WCK seamlessly, but i will insist on using "Composition" (if i understand the terminology correctly) to pass the art in anonymously (if we were to require art assets to have linkage to their specific functionality they would need to be recompiled every time that functionality changes, to have the changes take effect, which becomes a mess)

Inheritance is used mostly to allow flash to discover the inspectable component properties and let you tweak things on the stage. I really wish the component inspector was more robust. Building custom component interfaces may be something worth exploring.

On asset loading: If all you are loading is graphics, this is a piece of cake. Just attach the asset as a child to an existing BodyShape. Do you mean graphics & shape data? If that's the case then yes, something will need to be done so the whole framework wont have to be embedded in every asset.

Asset loading only seems necessary for extremely large projects though... I haven't built anything that needs it yet.

Quote:
also i think http://www.box2d.org/wiki would be a good place to do the documentation
as a branch off of the box2d wiki.


So long as that wiki isn't hacked and taken down :) Good start though.


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Mon Feb 08, 2010 9:35 am 
Offline

Joined: Tue Feb 24, 2009 4:10 pm
Posts: 438
Location: Michigan
Quote:
"I've seen other packages organized this way. Personally I find the deep folder hierarchy extremely cumbersome. That, and when defining symbols in Flash it is nicer to type "shapes.Box" as the base class rather than "com.sideroller.shapes.Box"."


understood. I think the developers would be happier with it all in one folder structure wise, perhaps even "wck.shapes.Box" and rename your cyrrent wck folder to "Core" or something.

as projects get handed down from one dev to another in a company, it would be unclear that these all came from the same source or that they are used together.

but i do understand that the linkage text area is not friendly with displaying long strings. and its easier to type something shorter than to copy paste something longer.

Quote:
On asset loading: If all you are loading is graphics, this is a piece of cake. Just attach the asset as a child to an existing BodyShape. Do you mean graphics & shape data? If that's the case then yes, something will need to be done so the whole framework wont have to be embedded in every asset.


i will start with just assets, but i think i would like to have shapes as part of assets down the road.

Quote:
Asset loading only seems necessary for extremely large projects though... I haven't built anything that needs it yet.


I have clients that request external art assets because it improves their work flow, if they want to swap out art, w/o recompiling the game they don't have to contact me.

all in all i don't think there will need to be any big changes to allow for external art.


Quote:
Building custom component interfaces may be something worth exploring

i have steered away from components personally. looking forward to seeing how you have yours setup.


ill try to focus on basic documentation first though.


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Tue Feb 09, 2010 2:14 am 
Offline

Joined: Tue Feb 09, 2010 1:57 am
Posts: 1
Hey,
First thanks for this great package!
I'm trying to do the same as clark, compiling the whole demo file in an swc and importing it in Flashdevelop. Then I add a world to the stage:
Code:
package
{
   import wck.WCK;
   
   public class Main extends WCK
   {
      
      public var world:World13;
      public function Main():void
      {
           super();   
               
           world = new World13();
           addChild(world);
      }
   }
}

Everything works fine when I add eg. world13. But it always throws an error when I compile for eg. world5 or world1.:
World1: [Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@248a741 to extras.JointClickRemove.
World5: [Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@2723c41 to extras.PlungerJoint.
Even though JointClickRemove extends Entity which extends MovieClip...
Anybody has a solution?


Top
 Profile  
 
 Post subject: Re: AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos
PostPosted: Tue Feb 09, 2010 5:08 am 
Offline

Joined: Tue Feb 09, 2010 4:16 am
Posts: 7
Hi Mayo!

First thanks for the great package! It looks incredible and will give a great opportunity to develop nice physics games.

But I have some problems running the demo. I have downloaded the last package of wck from github, but I can run the demo only if I let just one frame from the movie and I must to clear more than a half from the world symbol definitions from the fla library. There is no any error output, that can give me some clues.

I checked carefully the publish properties and they are set properly. Does somebody else have the same issue? Any clues?

I never worked with Alchemy before, but I think there is no need to have it installed as you have compiled the libraries to .wck already. Am I right?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 411 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12, 13 ... 42  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] and 1 guest


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 © 2000, 2002, 2005, 2007 phpBB Group