2
\$\begingroup\$

I have made games with box2dflash, but how much ever i have wanted to try out the test bed, the resources on the net don't help me. I have a folder called Testbed and various Test???.as files inside it. It would be a great help if somebody could just jot down how the testing of a box2dflash game is done. Thank you

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$
        package TestBed{

            //Do your imports   

            public class TestEmptyTest extends Test{

                public function TestEmptyTest(){
                    //Initialise your objects here
                }

                override public function Update():void {

                    //This is called for you by the Test class
                    //But you call this manually, to keep it syncing
                    super.Update();
                }

            } //TestEmptyTest

        } //TestBed

So, this is JUST the basic test class. If you throw this into the source path of your project, you should have a fully functional testbed test ready to use. If you want to see WHERE the test is added to the testbed itself, see the Main.as file in the root of the examples folder. This powers the TestBed application. More Notably, Look for the following on line 97 :

        var tests:Array = [

You can add your test by class name (TestEmptyTest), and it will show up in their list.

What makes it work?

1) Make sure you have the class path able to see the testbed folder

2) import TestBed.*; will bring the class into the Main.as already

3) creating a new instance of your class. Their framework does this for you, as long as you add it to their array.

Hope that helps!

More importantly, you gave almost no information. Some things you might want to include :

Version of Flex/Flash (And IDE)

Version of box2dflash

Code snippet of what it is that isn't working.

\$\endgroup\$
2
  • \$\begingroup\$ HEYY...thanks a lott i've been looking for this since months !! \$\endgroup\$
    – Vishnu
    Dec 10, 2010 at 9:24
  • \$\begingroup\$ Glad to have helped. \$\endgroup\$ Dec 23, 2010 at 1:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .