public CapturePoint() { Immovable = true; this.AddCollisionGroup("capturePoint"); this.Collidable = true; LoadTexture(Controller.Content.Load<Texture2D>("images/CapturePoint"), 128, 96); AddAnimation("uncaptured", new int[2] { 0 ,0 }, 0); AddAnimation("captured", new int[2] { 1, 1 }, 0); this.BloodParticles = new ParticleEngine(Controller.Content.Load<ParticleEffect>("bloodParticle")); state.AddChild(this.BloodParticles); this.BloodParticles.Position = this.Position; this.BloodParticles.Start(); this.GlowTexture = Controller.Content.Load<Texture2D>("glow"); CreateTakingOverRectangle(); AddAnimation("p1uncaptured", new int[1] { 0 }, 0); AddAnimation("p1captured", new int[3] { 1, 2, 3 },0.5f); AddAnimation("p2uncaptured", new int[1] { 0 }, 0); AddAnimation("p2captured", new int[3] { 4, 5, 6 }, 0.5f); AddAnimation("p3uncaptured", new int[1] { 0 }, 0); AddAnimation("p3captured", new int[3] { 7, 8, 9 }, 0.5f); AddAnimation("p4uncaptured", new int[1] { 0 }, 0); AddAnimation("p4captured", new int[3] { 10, 11, 12 }, 0.5f); soundTakeOver = Controller.Content.Load<SoundEffect>("sounds/takeOver"); soundTaken = Controller.Content.Load<SoundEffect>("sounds/winCapture"); }
public Bullet(Layer bulletLayer, BulletType bulletType) { this.Collidable = true; this.BulletType = bulletType; ParticleEffect effect = GameManager.Content.Load<ParticleEffect>(@"ParticleEffects/smoke1"); this.ParticleEngine = new ParticleEngine(effect); bulletLayer.AddChild(this.ParticleEngine); ParticleEffect effect2 = GameManager.Content.Load<ParticleEffect>(@"ParticleEffects/smokePuff"); this.ExplosionParticles = new ParticleEngine(effect2); bulletLayer.AddChild(this.ExplosionParticles); this.LoadTexture(this.BulletType.TextureName); this.AddCollisionGroup("bullet"); this.Deactivate(); }
public FatBomb() { this.Collidable = true; this.BoomParticles = new ParticleEngine(Controller.Content.Load<ParticleEffect>("splashBottom")); this.AddCollisionGroup("bomb"); this.Sprite = new Sprite(); this.Sprite.LoadTexture(Controller.Content.Load<Texture2D>(@"Assets/Bomb"), 48, 48); this.Sprite.Position = new Vector2(-32, -32); this.Sprite.AddAnimation("IDLE", new int[1] { 0 }, 0); this.Sprite.AddAnimation("CLOSETOEXPLODE", new int[4] { 0, 1, 0, 2 }, 0.3f); this.Sprite.AddAnimation("EXPLODE", new int[6] { 0, 1, 2, 3, 4, 5 }, 0.17f); this.AddChild(this.Sprite); this.gravity = 5; Controller.LayerController.GetLayer("bombLayer").AddChild(this.BoomParticles); this.Sprite.Scale *= 1.5f; this.Width = 16; this.Height = 16; }
public Vetbol(PlayerIndex playerIndex) { this.Collidable = true; index = playerIndex; this.IsFlickering = true; this.flickerTime = flickeringTime; this.ColorTimer = changeColorTime; Position = new Vector2(100, 100); this.captureParticles = new ParticleEngine(Controller.Content.Load<ParticleEffect>("captureParticle")); this.AddChild(this.captureParticles); this.dirtyParticles = new ParticleEngine(Controller.Content.Load<ParticleEffect>("dirtyParticle")); this.AddChild(this.dirtyParticles); this.deadParticles = new ParticleEngine(Controller.Content.Load<ParticleEffect>("deadParticles")); state.AddChild(this.deadParticles); image.LoadTexture(Controller.Content.Load<Texture2D>("images/slimeblobOther"), 48, 48); image.AddAnimation("IDLE", new int[1] { 0 }, 0); image.AddAnimation("CRAWLING", new int[2] { 1, 2 }, 0.5f); image.AddAnimation("JUMP", new int[1] { 3 }, 0); image.AddAnimation("ONWALL", new int[1] { 4 }, 0); image.AddAnimation("CAPTURING", new int[1] { 5 }, 0); image.AddAnimation("STUNNED", new int[3] { 6, 7, 8 }, 0.1f); image.Position = new Vector2(24, 14); if (index == PlayerIndex.One) { image.Color = Color.Yellow;//yellow } else if (index==PlayerIndex.Two) { image.Color = Color.CornflowerBlue; } else if (index == PlayerIndex.Three) { image.Color = Color.Lime; } else if (index == PlayerIndex.Four) { image.Color = Color.HotPink; } Width = 32; Height = 32; image.Origin = new Vector2(24, 24); AddChild(image); soundEffectWalk = Controller.Content.Load<SoundEffect>("sounds/walking"); soundEffectLand = Controller.Content.Load<SoundEffect>("sounds/landing"); soundEffectJump = Controller.Content.Load<SoundEffect>("sounds/jump"); this.AddCollisionGroup("player"); ParticleEffect effect = Controller.Content.Load<ParticleEffect>("spawnParticle"); effect.EmitterData[0].ReleaseColor = this.image.Color; this.spawnParticle = new ParticleEngine(effect); state.AddChild(this.spawnParticle); /*Sprite bb = new Sprite(); bb = Sprite.CreateRectangle(new Vector2(Width, Height), Color.Aqua); bb.Alpha = 0.5f; AddChild(bb);*/ }