Esempio n. 1
0
 public Fireball(Vector2 initialPosition, int direction)
     : base(new Vector2(initialPosition.X + 5, initialPosition.Y))
 {
     fireball = new Animation(Textures.GetTexture(Textures.Texture.fireball), new Rectangle(0, 0, 8, 8), 4, 0.05f, 0);
     explode = new Animation(Textures.GetTexture(Textures.Texture.fireball), new Rectangle(32, 0, 16, 16), 3, 0.1f, 0);
     position.X += 11 * direction;
     velocity.X = 170f * direction;
     explode.IsLooping = false;
     //fireball.IsLooping = true;
     fireball.Play();
     Sounds.Play(Sounds.SoundFx.fireball);
 }
Esempio n. 2
0
        public QuestionBlock(Vector2 position, Contains contains, bool isInvisible)
            : base(position)
        {
            this.isInvisible = isInvisible;
            item = contains;
            blockAnimation = new Animation(Textures.GetTexture(Textures.Texture.coinBlockAnimation), new Rectangle(0, 0 + (16 * World.WorldType), 16, 16), 6, animationSpeed, 0);
            blockAnimation.Play();

            emptyBlock = new Sprite(Textures.GetTexture(Textures.Texture.smbTiles), new Rectangle(34, 85, 16, 16));

            if (item == Contains.Coin)
            {
                coinAnimation = new Animation(Textures.GetTexture(Textures.Texture.coinFromBlockAnimation), new Rectangle(0, 0, 8, 64), 30, coinAnimationSpeed, 0);
                coinAnimationPosition = new Vector2(position.X + 4, position.Y - 48);
                coinAnimation.IsLooping = false;
                coinAnimation.IsPlaying = false;
            }

            bumpAmount = position.Y - bumpAmount;
            originalPosition = position.Y;
        }