protected override void Update(GameTime gameTime) { base.Update(gameTime); Controls(); ControlOpacity(gameTime); foreach (Nova_Particle p in particles) { p.Update(gameTime, Matrix.CreateTranslation(0, 0, 0)); } if (!isShow) { Nova_Particle p = new Nova_Particle(); p.SetTexture(Nova_DataBase.GetTexture("bar"), SpriteEffects.None, Microsoft.Xna.Framework.Color.Blue); p.Position = new Vector2(0, 75); p.LifeTime = 1500; p.InitialLifeTime = 1500; p.SetFadeOut(1500); p.IsAllColorsUntilDie = true; p.SetDirectionSpeed(new Vector2(20, 0)); p.inflateSizeHeight = (int)(sumPower * 3); p.SetInternalRotation(0, 1, Nova_Functions.GetCenterOf(p.GetCurrentTexture()), Nova_Particle.RotationDirectionEnum.clockwise); p.inflateSizeWidth = 10; emiters.Add(p); Nova_Particle.DoUpdateParticles(emiters, gameTime, Matrix.CreateTranslation(0, 0, 0)); } UpdatePlayer(); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black); GetForm().TopMost = true; GetForm().Show(); GetForm().BringToFront(); if (isShow) { GetForm().Location = new System.Drawing.Point(0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height - imageHeight); spriteBatch.Begin(); Vector2 centerImagePosition = new Vector2(0, (isShow ? 300 : 150) - imageHeight); spriteBatch.Draw(arts[index] == null ? Nova_DataBase.GetTexture("default") : arts[index], new Microsoft.Xna.Framework.Rectangle((int)centerImagePosition.X, (int)centerImagePosition.Y, imageWidth, imageHeight), Microsoft.Xna.Framework.Color.White); Nova_Functions.DrawBorderString(spriteBatch, Nova_DataBase.GetFont("font"), songs[index].Name.Substring(songs[index].Name.IndexOf("Musics") + 1 + "Musics".Length), new Vector2(550, 10), Microsoft.Xna.Framework.Color.Red, Microsoft.Xna.Framework.Color.Blue); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive); foreach (Nova_Particle p in particles) { p.Draw(spriteBatch); } spriteBatch.End(); } else { GetForm().Opacity = 0.5f; GetForm().Location = new System.Drawing.Point(0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height - imageHeight / 2); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive); Nova_Particle.DoDrawParticles(emiters, spriteBatch); spriteBatch.End(); } base.Draw(gameTime); }
public void CreateTextParticle() { InputSimulator simulator = new InputSimulator(); int index = 0; foreach (WindowsInput.Native.VirtualKeyCode key in Enum.GetValues(typeof(WindowsInput.Native.VirtualKeyCode))) { if (simulator.InputDeviceState.IsHardwareKeyDown(key) && !states[index]) { Nova_Particle p = new Nova_Particle(); string keyName = Enum.GetName(typeof(WindowsInput.Native.VirtualKeyCode), key); p.SetTextureFont(Nova_DataBase.GetFont("font"), keyName.Contains("_") ? keyName.Split('_')[1] : keyName, SpriteEffects.None, Microsoft.Xna.Framework.Color.White); p.Position = new Vector2(-Nova_DataBase.GetFont("font").MeasureString(keyName).X / 2, GraphicsDevice.Viewport.Height / 4); // p.SetDirectionRotation(Nova_Functions.GetRandomNumber(-5, 5), Nova_Functions.GetRandomNumber(-5, 5), 0, 0, 0, 0, Nova_Functions.GetRandomNumber(1, 5), Nova_Functions.GetRandomNumber(-1, 5), false); p.LifeTime = 7600; p.SetFadeOut(7600); p.SetInflateSpeed(1, 20, 1, 20, Nova_Particle.GrowingTypeEnum.asc); p.IsAllColorsUntilDie = true; p.InitialLifeTime = 7600; p.SetDirectionSpeed(new Vector2(6, 0)); emitersText.Add(p); } states[index] = simulator.InputDeviceState.IsHardwareKeyDown(key); index++; } }
private void LoadParticles() { for (int i = 0; i < 256; i++) { Nova_Particle p = new Nova_Particle(); p.SetTexture(Nova_DataBase.GetTexture("bar"), SpriteEffects.None, Microsoft.Xna.Framework.Color.Purple); p.Position = new Vector2(imageWidth + 50 + (i * 5), 160); particles[i] = p; } }
private void LoadParticles() { for (int i = 0; i < QTD_BARS; i++) { Nova_Particle p = new Nova_Particle(); p.SetTexture(Nova_DataBase.GetTexture("bar"), SpriteEffects.None, Microsoft.Xna.Framework.Color.White); p.ParticleColor = Nova_Functions.HSVToColor((6f / (float)QTD_BARS * i), 1, 1); // p.Position = new Vector2(((float)Nova_Functions.View.Width / QTD_BARS) * i, Nova_Functions.View.Height / 2 - p.GetCurrentTexture().Height / 2); p.Position = new Vector2(((float)Nova_Functions.View.Width / QTD_BARS) * i, 0); // p.SetAngle(-i, Nova_Functions.GetCenterOf(p.GetCurrentTexture())); // p.SetDirectionRotation(400, 200, 0, 0, i, i, 0, 0, true); p.IsInflateBothSides = true; particles[i] = p; } }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black); GetForm().TopMost = true; GetForm().Opacity = opacity; if (change) { GetForm().Size = new Size(Nova_Functions.View.Width, Nova_Functions.View.Height); GetForm().Show(); GetForm().BringToFront(); } change = false; GraphicsDevice.SetRenderTarget(target); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive); Nova_Particle.DoDrawParticles(emitersText, spriteBatch); Nova_Particle.DoDrawParticles(particles.ToList(), spriteBatch); //for ( int i = 0; i < emiters.Count; i++) //{ // Nova_Particle p = emiters[i]; // p.Draw(spriteBatch); // if (p.LifeTime <= 0) // { // emiters.Remove(p); // i--; // } //} spriteBatch.End(); GraphicsDevice.SetRenderTarget(null); spriteBatch.Begin(0, BlendState.Additive); spriteBatch.Draw(target, Vector2.Zero, Microsoft.Xna.Framework.Color.White); spriteBatch.Draw(target, Nova_Functions.ReturnScreenRectangle(), null, Microsoft.Xna.Framework.Color.White, 0, Vector2.Zero, SpriteEffects.FlipVertically | SpriteEffects.FlipHorizontally, 1f); spriteBatch.End(); base.Draw(gameTime); }
protected override void Update(GameTime gameTime) { try { base.Update(gameTime); Controls(); foreach (Nova_Particle bar in particles) { bar.Update(gameTime, Matrix.CreateTranslation(0, 0, 0)); } //Nova_Particle p = new Nova_Particle(); //p.SetTexture(starTexture, SpriteEffects.None, Microsoft.Xna.Framework.Color.White); //p.Position = new Vector2(-p.GetCurrentTexture().Width, Nova_Functions.View.Height - p.GetCurrentTexture().Height/2); //p.DestroyOnLeaveScreen = true; //int time = 3600; //p.LifeTime = time; //p.IsInflateBothSides = false; //p.InitialLifeTime = time; //p.SetFadeOut(time); ////p.SetInternalRotation(0, 2, Nova_Functions.GetCenterOf(p.GetCurrentTexture()), Nova_Particle.RotationDirectionEnum.clockwise); //p.SetInflateSize(0, -24 + (int)Math.Floor(sumPower)*5); //p.SpeedX = 20; //p.AcelerationFactorX = 0.9875f; //p.IsAllColorsUntilDie = true; ////p.SetDirectionRotation(4.0f, 2.0f, 0, 0, 0, 0, 1, 1, false); //emiters.Add(p); Nova_Particle.DoUpdateParticles(emiters, gameTime, Matrix.CreateTranslation(0, 0, 0)); // CreateTextParticle(); Nova_Particle.DoUpdateParticles(emitersText, gameTime, Matrix.CreateTranslation(0, 0, 0)); UpdatePlayer(); } catch { player.ClearInstance(); player.StartCaptureAudioFromDefaultPlayerDevice(); } }
private void DrawNoteMiss(int pos) { Nova_Particle p = new Nova_Particle(); p.SetTexture((Texture2D)Nova_DataBase.GetResource("NOTE_HIT_" + (pos + 1).ToString()), SpriteEffects.None, Color.Red); p.SetPosition(offNotes[pos].pos); p.SetInflateSpeed(6, 20, 6, 20, Nova_Particle.GrowingType.asc); p.SetLifeTime(300); p.SetFadeOut(300); notes.Add(p); }
private void CreateStep(int posNumber) { Nova_Particle p = new Nova_Particle(); p.SetTexture((List<Texture2D>)Nova_DataBase.GetResource("NOTE_" + (posNumber+1).ToString()), SpriteEffects.None, Color.White); p.SetPosition(new Vector2(posNumber * stepSpace + Nova_Functions.View.Width / 2 - ((numberOfSteps * stepSpace) / 2), -p.texture[0].Height)); p.SetAnimation(4, 1, 120, true); p.SetID(posNumber.ToString()); p.SetDirectionSpeed(new Vector2(0, stepSpeed)); notes.Add(p); }