Exemple #1
0
 public void ProcessObject(List <List <Object> > matrix)
 {
     for (int i = 0; i < width; i++)
     {
         for (int j = 0; j < height; j++)
         {
             IPowerUp[] p = GetContents(matrix, x + i, y + j);
             if (contains.Equals("multicoin"))
             {
                 matrix[x + i].Add(new BlockMultiCoin(p, 16 * (x + i), 16 * (y + j)));
             }
             else
             {
                 if (contains.Equals("vine"))
                 {
                     Vine v = new Vine(go, y + j + 1, 16 * (x + i), -1000);
                     matrix[x + i].Add(v);
                     VineSpawner spawner = new VineSpawner(v, 16 * (x + i), 16 * (y + j));
                     matrix[x + i].Add(spawner);
                     p = new IPowerUp[] { spawner };
                 }
                 matrix[x + i].Add(new BlockBrick(p, 16 * (x + i), 16 * (y + j)));
             }
         }
     }
 }
        public void Spawn()
        {
            Vine v = ((VineSpawner)Powerup).vine;

            v.Position       = new Vector2(Powerup.Position.X, Powerup.Position.Y - v.Hitbox.Height());
            Powerup.IsActive = false;

            SoundPanel.PlaySoundEffect(Sound.vineEffect);
        }
 public VineSpawner(Vine vine, int x = 0, int y = 0)
 {
     this.Position         = new Vector2(x, y);
     this.Velocity         = Vector2.Zero;
     this.Acceleration     = Vector2.Zero;
     this.Hitbox           = new Hitbox(Hitboxes.ROPE_OFFSET_X, Hitboxes.ROPE_OFFSET_Y);
     this.State            = new SVineSpawnerInBlock(this);
     this.Sprite           = new FlagpoleAnimation(Textures.vine, 1);
     this.IsActive         = true;
     this.CollisionHandler = new VineSpawnerCollisionHandler(this);
     this.vine             = vine;
 }