예제 #1
0
 public void CreateWeaponBurstEffect(Player.Player player, Projectile proj, ContentManager content)
 {
     //position = player.weapon.tipPos;
     Velocity = new Vector2(0, 0);
     int maxTanSpeed = 10;
     Velocity.X = (float)(GameWorld.RandGen.Next((int)(proj.GetVelocity().X - maxTanSpeed), (int)(proj.GetVelocity().X + maxTanSpeed + 1)));
     Velocity.Y = (float)(GameWorld.RandGen.Next((int)(proj.GetVelocity().Y - maxTanSpeed), (int)(proj.GetVelocity().Y + maxTanSpeed + 1)));
     CurrentParticle = ParticleType.WeaponBurst;
     Texture = ContentHelper.LoadTexture("Effects/laser_burst");
     int randSize = GameWorld.RandGen.Next(2, 5);
     CollRectangle = new Rectangle((int)Position.X, (int)Position.Y, randSize, randSize);
     SourceRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height);
     Opacity = 1;
 }
예제 #2
0
 public void CreateEnemyDisintegrationEffect(Enemy enemy, Rectangle sourceRectangle, Projectile proj)
 {
     CurrentParticle = ParticleType.EnemyDesintegration;
     Texture = enemy.Texture;
     CollRectangle = new Rectangle(enemy.GetCollRectangle().X + sourceRectangle.X, enemy.GetCollRectangle().Y + sourceRectangle.Y,
         sourceRectangle.Width, sourceRectangle.Height);
     this.SourceRectangle = sourceRectangle;
     int maxTanSpeed = 10;
     Velocity.X = (float)(GameWorld.RandGen.Next((int)(proj.GetVelocity().X - maxTanSpeed), (int)(proj.GetVelocity().X + maxTanSpeed + 1)));
     Velocity.Y = (float)(GameWorld.RandGen.Next((int)(proj.GetVelocity().Y - maxTanSpeed), (int)(proj.GetVelocity().Y + maxTanSpeed + 1)));
 }
예제 #3
0
        public Particle(Enemy enemy, Projectile projectile)
        {
            SourceRectangle = new Rectangle(0, 0, 32, 32);
            CurrentParticle = ParticleType.Impact;
            Texture = ContentHelper.LoadTexture("Explosion");

            if (projectile.GetVelocity().X > 0)
                CollRectangle = new Rectangle(enemy.GetCollRectangle().X - enemy.GetCollRectangle().Width / 2, projectile.GetCollRectangle().Center.Y - SourceRectangle.Height / 2, 32, 32);
            else CollRectangle = new Rectangle(enemy.GetCollRectangle().X + enemy.GetCollRectangle().Width / 2, projectile.GetCollRectangle().Center.Y - SourceRectangle.Height / 2, 32, 32);
            _frameCount = new Vector2(Texture.Width / 32, Texture.Height / 32);
        }
예제 #4
0
 public Particle(Projectile proj)
 {
     CurrentParticle = ParticleType.SnakeVenom;
     Texture = ContentHelper.LoadTexture("Effects/venom_blob");
     _randGen = new Random();
     CollRectangle = new Rectangle(proj.GetCollRectangle().X + proj.GetCollRectangle().Width / 2, proj.GetCollRectangle().Y, 8, 8);
     if (proj.GetVelocity().X > 0)
         Velocity.X = -2;
     else Velocity.X = 2;
     Velocity.Y = GameWorld.RandGen.Next(1, 4);
     if (GameWorld.RandGen.Next(0, 2) == 0)
         Velocity.Y = -Velocity.Y;
     SourceRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height);
     Opacity = 1f;
 }
예제 #5
0
 public Particle(Projectile projectile, Tile[] tileArray)
 {
     SourceRectangle = new Rectangle(0, 0, 32, 32);
     CurrentParticle = ParticleType.Impact;
     Texture = ContentHelper.LoadTexture("Explosion");
     if (projectile.GetVelocity().X > 0)
         CollRectangle = new Rectangle(tileArray[projectile.TileHit].DrawRectangle.X - 32, projectile.GetCollRectangle().Center.Y - 32, 64, 64);
     else CollRectangle = new Rectangle(tileArray[projectile.TileHit].DrawRectangle.X + 32, projectile.GetCollRectangle().Center.Y - 32, 64, 64);
     _frameCount = new Vector2(Texture.Width / 32, Texture.Height / 32);
 }