コード例 #1
0
ファイル: Test.cs プロジェクト: songfulin/CocosSharp
        public Test()
        {
            m_destructionListener = new DestructionListener();
            m_debugDraw           = new CCBox2dDraw("fonts/arial-12");

            b2Vec2 gravity = new b2Vec2();

            gravity.Set(0.0f, -10.0f);
            m_world      = new b2World(gravity);
            m_bomb       = null;
            m_textLine   = 30;
            m_mouseJoint = null;
            m_pointCount = 0;

            m_destructionListener.test = this;
            m_world.SetDestructionListener(m_destructionListener);
            m_world.SetContactListener(this);
            m_world.SetDebugDraw(m_debugDraw);
            m_world.SetContinuousPhysics(true);
            m_world.SetWarmStarting(true);

            m_bombSpawning = false;

            m_stepCount = 0;

            b2BodyDef bodyDef = new b2BodyDef();

            m_groundBody = m_world.CreateBody(bodyDef);
        }