コード例 #1
0
        // Constructor
        public SpikeTile(World world, Vector2 position, float width, float height)
            : base(world)
        {
            this.Width  = ConvertUnits.ToSimUnits(width);
            this.Height = ConvertUnits.ToSimUnits(height);

            // Make the spike in the physics world
            physicsObj = new StaticPhysicsObject(this, this.world, position, width, height);
            physicsObj.body.Restitution  = 0f;
            physicsObj.CollisionCategory = GameConstants.GroundCollisionCategory | GameConstants.DeathCollisionCategory;
        }
コード例 #2
0
ファイル: SpikeTile.cs プロジェクト: psykano/STFU-xna
        // Constructor
        public SpikeTile(World world, Vector2 position, float width, float height)
            : base(world)
        {
            this.Width = ConvertUnits.ToSimUnits(width);
            this.Height = ConvertUnits.ToSimUnits(height);

            // Make the spike in the physics world
            physicsObj = new StaticPhysicsObject(this, this.world, position, width, height);
            physicsObj.body.Restitution = 0f;
            physicsObj.CollisionCategory = GameConstants.GroundCollisionCategory | GameConstants.DeathCollisionCategory;
        }
コード例 #3
0
        // Constructor
        public GroundTile(World world, Vector2 position, float width, float height, float rotation)
            : base(world)
        {
            this.Width    = ConvertUnits.ToSimUnits(width - 0.1f); // the 0.1f _might_ fix a weird bug in farseer
            this.Height   = ConvertUnits.ToSimUnits(height);
            this.rotation = rotation;

            // Make the ground in the physics world
            physicsObj = new StaticPhysicsObject(this, this.world, position, width, height);
            physicsObj.body.Restitution  = 0f;
            physicsObj.CollisionCategory = GameConstants.GroundCollisionCategory;
        }
コード例 #4
0
ファイル: GroundTile.cs プロジェクト: psykano/STFU-xna
        // Constructor
        public GroundTile(World world, Vector2 position, float width, float height, float rotation)
            : base(world)
        {
            this.Width = ConvertUnits.ToSimUnits(width - 0.1f); // the 0.1f _might_ fix a weird bug in farseer
            this.Height = ConvertUnits.ToSimUnits(height);
            this.rotation = rotation;

            // Make the ground in the physics world
            physicsObj = new StaticPhysicsObject(this, this.world, position, width, height);
            physicsObj.body.Restitution = 0f;
            physicsObj.CollisionCategory = GameConstants.GroundCollisionCategory;
        }
コード例 #5
0
ファイル: CheckpointTile.cs プロジェクト: psykano/STFU-xna
        // Constructor
        public CheckpointTile(World world, Vector2 position, float width, float height, EntityManager entityManager)
            : base(world)
        {
            this.Width = ConvertUnits.ToSimUnits(width);
            this.Height = ConvertUnits.ToSimUnits(height);
            this.Activated = false;
            this.entityManager = entityManager;

            // Make the checkpoint in the physics world only as a sensor
            physicsObj = new StaticPhysicsObject(this, this.world, position, width, height);
            physicsObj.body.IsSensor = true;
            physicsObj.body.OnCollision += new OnCollisionEventHandler(onCollision);
        }
コード例 #6
0
        // Constructor
        public CheckpointTile(World world, Vector2 position, float width, float height, EntityManager entityManager)
            : base(world)
        {
            this.Width         = ConvertUnits.ToSimUnits(width);
            this.Height        = ConvertUnits.ToSimUnits(height);
            this.Activated     = false;
            this.entityManager = entityManager;

            // Make the checkpoint in the physics world only as a sensor
            physicsObj = new StaticPhysicsObject(this, this.world, position, width, height);
            physicsObj.body.IsSensor     = true;
            physicsObj.body.OnCollision += new OnCollisionEventHandler(onCollision);
        }