Example #1
0
        public Zombie(Rectangle pos, Map m)
            : base(m)
        {
            Body BodyDec = new Body(m.PhysicalWorld);
            BodyDec.BodyType = BodyType.Dynamic;

            Fixture = BodyDec.CreateFixture(new CircleShape(15f, 2.5f));
            //Fixture.Restitution = 0f;

            walkAnim = new Animation();
            walkNormalAnim = new AnimationNormal();

            walkAnim.Load("ZombieAnim", Vector2.One * 64, 6, 200);
            walkNormalAnim.Load("ZombieAnim_normal", Vector2.One * 64, 6, 200, (LightingEngine)Renderer.GetRenderEffect("LightingEngine"));

            walkAnim.Center = Vector2.One * 32;
            walkNormalAnim.Center = Vector2.One * 32;

            Position = pos;
            hp = 100;
            def = 1;
            damage = 2;
            lucky = 1;

            SetName("zombie");

            sounds = new Dictionary<string, ISound>();

            //sounds.Add("Sounds/Mobs/zombie_walk", GeneralManager.Sounds["Sounds/Mobs/zombie_walk"].CreateInstance());
            //sounds.Add("zombie_moan", GeneralManager.Sounds["Sounds/Mobs/zombie_moan"].CreateInstance());

            //pfinder = new PathFinderFast(m.GetChunk().GetCostArray());
        }
Example #2
0
        public FloorFan(Rectangle r, Map m)
            : base(m)
        {
            LightingEngine LE = (LightingEngine)Renderer.GetRenderEffect("LightingEngine");

            FanAnim = new Animation();
            FanNormalAnim = new AnimationNormal();

            FanAnim.Load("FloorFan", Vector2.One * 128, 6, 50);
            FanNormalAnim.Load("FloorFan_normal", Vector2.One * 128, 6, 50, LE);

            Position = r;
            FanAnim.Position = Position;
            FanNormalAnim.Position = Position;

            SetName("FloorFan");
        }
Example #3
0
        public Player(Rectangle pos, Map m)
            : base(m)
        {
            Body BodyDec = new Body(m.PhysicalWorld);
            BodyDec.BodyType = BodyType.Dynamic;

            Fixture = BodyDec.CreateFixture(new CircleShape(15f, 1.0f));

            Body BodyDecSensor = new Body(m.PhysicalWorld);
            BodyDecSensor.BodyType = BodyType.Dynamic;

            PlayerSensor = BodyDecSensor.CreateFixture(new CircleShape(15f, .0f));
            PlayerSensor.Body.IsSensor = true;
            PlayerSensor.OnCollision += OnSensorCollide;

            this.Name = "player";
            this.texName = "Mobs/" + Name;
            this.normalName = "Mobs/" + Name + "_normal";

            this.Position = pos;
            hp = 100;
            def = 10;
            damage = 5;
            lucky = 123135;
            this.map = m;
            speed = 15500f;

            weapon = new AK47();

            IdleAnim = new Animation();
            IdleNormalAnim = new AnimationNormal();

            WalkAnim = new Animation();
            WalkNormalAnim = new AnimationNormal();

            IdleAnim = GeneralManager.Animations["PlayerIdle"];
            IdleAnim.Center = Vector2.One * 32;

            IdleNormalAnim.Load("PlayerIdle_normal", Vector2.One * 64, 1, 10000, (LightingEngine)Renderer.GetRenderEffect("LightingEngine"));
            IdleNormalAnim.Center = Vector2.One * 32;

            WalkAnim = GeneralManager.Animations["TestAnim"];
            WalkAnim.Center = Vector2.One * 32;

            WalkNormalAnim.Load("TestAnim_normal", Vector2.One * 64, 6, 80, (LightingEngine)Renderer.GetRenderEffect("LightingEngine"));
            WalkNormalAnim.Center = Vector2.One * 32;

            LightingEngine LE = (LightingEngine)Renderer.GetRenderEffect("LightingEngine");

            ShootLight = new SpotLight()
            {
                IsEnabled = true,
                Color = new Vector4(0.95f, .7f, .05f, 1f),
                Power = .6f,
                LightDecay = 600,
                Position = new Vector3(500, 400, 20),
                SpotAngle = 2f * 3.1415f,
                SpotDecayExponent = 3,
                Direction = new Vector3(0.244402379f, 0.969673932f, 0)
            };

            LE.AddLight(ShootLight);

            stoper = new Stopwatch();
            stoper.Start();
        }