public FreezeShot(Rectangle position, ContentManager contentRef, float angle, Ammo ammo) : base(position, contentRef) { imageDictionary = new Dictionary<State, Texture2D>(); imageDictionary.Add(State.charge, contentRef.Load<Texture2D>("IceChunk")); imageDictionary.Add(State.fire, contentRef.Load<Texture2D>("Shot")); imageDictionary.Add(State.explosion, contentRef.Load<Texture2D>("PowerUps")); pos = new Vector2(position.X, position.Y); velocity.X = (float)(Math.Cos(angle) * SPEED); velocity.Y = (float)(Math.Sin(angle) * SPEED); Console.WriteLine(angle); color = ammo.Color; counter = 0; currentState = State.charge; texture = imageDictionary[currentState]; active = true; fireTexture = contentRef.Load<Texture2D>("vortex"); frostEmitter = new FrostEmitter(fireTexture, position, .1f); }
protected void addAmmo() { if (guage.Stockpile.Count <= 9) { Rectangle startingPosition = new Rectangle((int)(guage.getMidPoint().X - guage.Position.Width / 4), (int)guage.Position.Y, (int)guage.Position.Width / 2, (int)guage.Position.Width / 2); Color color; Random rand = new Random(); if (rand.Next(5) == 0) { color = Color.Azure; } else if (rand.Next(5) == 1) { color = Color.Green; } else if (rand.Next(5) == 2) { color = Color.Red; } else if (rand.Next(5) == 3) { color = Color.Lavender; } else color = Color.LightCoral; Ammo tmp = new Ammo(startingPosition, this.Content, color); guage.Stockpile.Enqueue(tmp); childComponent.Add(tmp); } }
public void addAmmo(Meteor meteor) { if (stockpile.Count < 11) { Rectangle startingPosition = new Rectangle((int)(this.getMidPoint().X - this.Position.Width / 4), (int)(this.getMidPoint().Y - this.Position.Height / 4), (int)this.Position.Width / 4, (int)this.Position.Width / 4); Ammo tmp = new Ammo(startingPosition, contentRef, meteor.Color); stockpile.Enqueue(tmp); } }
public FreezeShot(Rectangle position, ContentManager contentRef, float angle, Ammo ammo) : base(position, contentRef) { imageDictionary = new Dictionary <State, Texture2D>(); imageDictionary.Add(State.charge, contentRef.Load <Texture2D>("IceChunk")); imageDictionary.Add(State.fire, contentRef.Load <Texture2D>("Shot")); imageDictionary.Add(State.explosion, contentRef.Load <Texture2D>("PowerUps")); pos = new Vector2(position.X, position.Y); velocity.X = (float)(Math.Cos(angle) * SPEED); velocity.Y = (float)(Math.Sin(angle) * SPEED); Console.WriteLine(angle); color = ammo.Color; counter = 0; currentState = State.charge; texture = imageDictionary[currentState]; active = true; fireTexture = contentRef.Load <Texture2D>("vortex"); frostEmitter = new FrostEmitter(fireTexture, position, .1f); }