public ZombieBig(Rectangle pos, Map m) : base(m) { Body BodyDec = new Body(m.PhysicalWorld); BodyDec.BodyType = BodyType.Dynamic; speed = 12000f; Fixture = BodyDec.CreateFixture(new CircleShape(22f, 1.5f)); //Fixture.Restitution = 0f; walkAnim = new Animation(); walkNormalAnim = new AnimationNormal(); walkAnim.Load("ZombieBig", Vector2.One * 64, 21, 40); walkNormalAnim.Load("ZombieBig_normal", Vector2.One * 64, 21, 40, (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("zombieBig"); 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()); }
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"); }
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(); }