示例#1
0
        public TntEntity(Game game, short newFuse, float newTntPower) : base(game)
        {
            interp             = new LocalInterpComponent(game, this);
            collisions         = new CollisionsComponent(game, this);
            physics            = new PhysicsComponent(game, this);
            physics.hacks      = hacks;
            physics.collisions = collisions;

            this.Velocity = new Vector3(0, 0.2f, -0.02f);

            SetModel("46");

            if (newFuse >= 0)
            {
                this.ModelScale += 0.003f * (fuse - newFuse);
                fuse             = newFuse;
            }

            if (newTntPower >= 0)
            {
                this.tntPower = newTntPower;
            }

            //this.Velocity = new Vector3(0, 0.2f, -0.02f);
        }
示例#2
0
        public MobEntity(Game game, string model) : base(game)
        {
            StepSize = 0.5f;
            SetModel(model);
            interp = new LocalInterpComponent(game, this);

            collisions         = new CollisionsComponent(game, this);
            physics            = new PhysicsComponent(game, this);
            physics.hacks      = hacks;
            physics.collisions = collisions;

            if (Utils.CaselessEq(model, "pig") || Utils.CaselessEq(model, "sheep"))
            {
                ai = new FleeAI(game, this);
            }
            else
            {
                ai = new HostileAI(game, this);
            }
        }