Exemplo n.º 1
0
        /// <summary>
        /// Called to register this block with the collision contexts, etc.
        /// </summary>
        /// <param name="arena"></param>
        public void Bind(LoadableBattleArena arena)
        {
            // Define the ground box shape.
            PolygonDef groundShapeDef = new PolygonDef();

            groundShapeDef.SetAsBox(Width / 2, Height / 2, new Box2DX.Common.Vec2(Position.X, Position.Y), 0);

            // Add the ground shape to the ground body.
            Fixture fix = arena.GroundBody.CreateFixture(groundShapeDef);

            fix.UserData            = arena;
            fix.Filter.CategoryBits = (ushort)Layer;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called to register this block with the collision contexts, etc.
        /// </summary>
        /// <param name="arena"></param>
        public void Bind(LoadableBattleArena arena)
        {
            // Define the ground box shape.
            PolygonDef groundShapeDef = new PolygonDef();
            groundShapeDef.SetAsBox(Width / 2, Height / 2, new Box2DX.Common.Vec2(Position.X, Position.Y), 0);

            // Add the ground shape to the ground body.
            Fixture fix = arena.GroundBody.CreateFixture(groundShapeDef);

            fix.UserData = arena;
            fix.Filter.CategoryBits = (ushort)Layer;
        }