Ejemplo n.º 1
0
        protected void Explode()
        {
            if(timer >= -.75)
            {
                explodeLocation = position;
                int xShift = Game1.random.Next(6) - 3;
                int yShift = Game1.random.Next(6) - 3;
                explodeLocation.X += xShift;
                explodeLocation.Y += yShift;

                if (!exploded)
                {
                    Game1.world.RemoveBody(bombBody);
                    bombExplosion = new Explosion(Game1.world, 500f, UnitConverter.toSimSpace(position));
                    exploded = true;
                }
            }
            else
            {
                bombExplosion.cleanExplosion();
                destroyed = true;
            }
        }
Ejemplo n.º 2
0
        protected void Explode()
        {
            //exploded = true;
            if (timer >= -.75)
            {
                explodeLocation = position;
                image = Game1.mineExplodeImage;
                int xShift = Game1.random.Next(6) - 3;
                int yShift = Game1.random.Next(6) - 3;
                explodeLocation.X += xShift;
                explodeLocation.Y += yShift;
                timer -= .025f;

                if (!exploded)
                {
                    Game1.world.RemoveBody(mineBody);
                    mineExplosion = new Explosion(Game1.world, 500f, mineBody.Position);
                    exploded = true;
                }
            }
            else if(!destroyed)
            {
                mineSFXInstance.Stop();
                mineExplosion.cleanExplosion();
                destroyed = true;
            }
        }