Esempio n. 1
0
        public override void Update()
        {
            base.Update();

            if (lifetime < 0)
            {
                Explosion.Create(this, position, new Explosion.Config(ExplosionShrapnel, DuckUtils.GetAsset("sounds/frog_explosion.wav"), false));
                for (int i = 0; i < 2; i++)
                {
                    Level.Add(SmallSmoke.New(x + Rando.Float(-8f, 8f), y + Rando.Float(-8f, 8f)));
                }
                Level.Remove(this);
            }
            else
            {
                lifetime -= Maths.IncFrameTimer();
            }

            UpdateBehavior();
        }
Esempio n. 2
0
        public override void Update()
        {
            if (netEquippedDuck != null && !Playing)
            {
                sound.Play();
                Playing = true;
            }

            if (Playing)
            {
                Timer  += Maths.IncFrameTimer();
                graphic = pickupSprite = _sprite = new SpriteMap(DuckUtils.GetAsset("hats/imstuff.png"), 129, 153);

                if (Timer > 18.2f)
                {
                    Explosion.Create(this, position, ExplosionShrapnel);

                    netEquippedDuck = null;
                    Level.Remove(this);
                }
            }

            base.Update();
        }
Esempio n. 3
0
 private void Explode()
 {
     Explosion.Create(this, position);
     Playing = false;
 }
Esempio n. 4
0
 protected override void CreateExplosion(Vec2 pos)
 {
     Explosion.Create(this, pos);
 }