Exemplo n.º 1
0
        public PowerUp(TileMap level, Vector2 initPos, IPowerUp state) : base(level, initPos)
        {
            State                  = state;
            TextureType            = State.GetTextureType();
            CollisionBox.ColorType = typeof(PowerUp);

            if (State is Flower)
            {
                Sprite = new PowerUpSprite(1, 2, 0, this);
            }
            else if (State is SuperMushroom)
            {
                Sprite = new PowerUpSprite(1, 2, 1, this);
            }
            else if (State is LifeMushroom)
            {
                Sprite = new PowerUpSprite(1, 2, 0, this);
            }
            else if (State is Starmans)
            {
                Sprite = new PowerUpSprite(1, 2, 1, this);
            }
            else if (State is Sanitizer)
            {
                Sprite       = new PowerUpSprite(1, 1, 0, this);
                Acceleration = Vector2.Zero;
                CanClip      = false;
            }
            else if (State is Vaccine)
            {
                Sprite       = new PowerUpSprite(1, 1, 0, this);
                Acceleration = Vector2.Zero;
                CanClip      = false;
            }
            else if (State is Mask)
            {
                Sprite       = new PowerUpSprite(1, 1, 0, this);
                Acceleration = Vector2.Zero;
                CanClip      = false;
            }
        }