public WinScreen() { rand = new Random(DateTime.Now.Millisecond); winScreenBackground = Engine.ContentManager.Load <Texture2D>("winScreenBackground"); winner = Engine.ContentManager.Load <Texture2D>("playerOneWins"); fireworks = new ParticleSettings[EMITTER_COUNT]; for (int i = 0; i < EMITTER_COUNT; i++) { fireworks[i] = new ParticleSettings(Engine.graphics.GraphicsDevice, null, 1000); fireworks[i].LoadFromFile("Content/fireworks.psf", true); fireworks[i].MinSpeed = 32; fireworks[i].MaxSpeed = 64; } emitters = new ParticleEmitter[EMITTER_COUNT]; for (int i = 0; i < EMITTER_COUNT; i++) { emitters[i] = new ParticleEmitter(Engine.spriteBatch, fireworks[i]); emitters[i].Position = new Vector2(rand.Next(1280), rand.Next(1024)); emitters[i].TimeLimit = TimeSpan.FromMilliseconds(750); emitters[i].elapsed = TimeSpan.FromMilliseconds(751); emitters[i].SetColour2(colors[rand.Next(colors.Length)]); } }
public Terrain(Game g) : base(g) { terrain = Engine.ContentManager.Load <Texture2D>("mapTop"); collisionMap = Engine.ContentManager.Load <Texture2D>("collisionMap"); powerups = new List <Powerup>(); waterOne = Engine.ContentManager.Load <Texture2D>("waterOne"); waterTwo = Engine.ContentManager.Load <Texture2D>("waterTwo"); Color[] collisionColours = new Color[collisionMap.Width * collisionMap.Height]; collisionData = new bool[collisionMap.Width * collisionMap.Height]; collisionMap.GetData <Color>(collisionColours); for (int i = 0; i < collisionColours.Length; i++) { collisionData[i] = collisionColours[i] != Colour.Black; } rand = new Random(DateTime.Now.Millisecond); powerupSettings = new ParticleSettings(Engine.graphics.GraphicsDevice, null, 1000); powerupSettings.LoadFromFile("Content/powerup.psf", true); powerupEmitters = new List <ParticleEmitter>(10); }
public ParticleEmitter(SpriteBatch s, ParticleSettings settings) { //Loop = true; this.s = s; this.settings = settings; particles = new Particle[settings.MaxParticles]; if (r == null) { r = new Random((int)System.DateTime.Now.Ticks); } elapsed = TimeSpan.FromMilliseconds(251); TimeLimit = TimeSpan.FromMilliseconds(250); }
public Hut(Vector2 position, int maxPeons, float spawnRadius, Engine game, Texture2D texture) { this.position = position; this.maxPeons = maxPeons; this.spawnRadius = spawnRadius; this.game = game; hutTexture = Engine.ContentManager.Load <Texture2D>("vilageSingle"); smokeSettings = new ParticleSettings(Engine.graphics.GraphicsDevice, null, 1000); smokeSettings.LoadFromFile("Content/Smoke.psf", true); smokeSettings.StartColours[0] = new Color(Color.White, 0.5f); smokeSettings.EndColours[0] = new Color(Color.Gray, 0.5f); smokeEmitter = new ParticleEmitter(Engine.spriteBatch, smokeSettings); smokeEmitter.Position = this.position + new Vector2(61, 60); smokeEmitter.TimeLimit = TimeSpan.FromDays(1); peonsAvaible = new List <Peon>(); }
public ButtonCombo(PlayerIndex player) { this.player = player; particleSettings = new ParticleSettings(Engine.graphics.GraphicsDevice, null, 500); particleSettings.LoadFromFile("Content/buttonpress.psf", true); emitter = new ParticleEmitter(Engine.spriteBatch, particleSettings); emitter.Position += this.position + buttonPosition + new Vector2(10, 10); background = Engine.ContentManager.Load <Texture2D>("combo_background"); if (buttonTextures == null) { buttonTextures = new Texture2D[4]; buttonTextures[0] = Engine.ContentManager.Load <Texture2D>("button_a"); buttonTextures[1] = Engine.ContentManager.Load <Texture2D>("button_b"); buttonTextures[2] = Engine.ContentManager.Load <Texture2D>("button_x"); buttonTextures[3] = Engine.ContentManager.Load <Texture2D>("button_y"); } if (buttons == null) { buttons = new Buttons[4]; buttons[0] = Buttons.A; buttons[1] = Buttons.B; buttons[2] = Buttons.X; buttons[3] = Buttons.Y; } if (rand == null) { rand = new Random(DateTime.Now.Millisecond); } buttonQueue = new Queue <byte>(5); for (int i = 0; i < 5; i++) { buttonQueue.Enqueue((byte)rand.Next(4)); } Engine.InputManager.ButtonUp += new Input.ControllerButtonEvent(InputManager_ButtonUp); }