コード例 #1
0
ファイル: Fireball.cs プロジェクト: Exor/SuperMarimoBros
 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);
 }
コード例 #2
0
ファイル: QuestionBlock.cs プロジェクト: Exor/SuperMarimoBros
        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;
        }
コード例 #3
0
ファイル: Marimo.cs プロジェクト: Exor/SuperMarimoBros
        public void Load()
        {
            Texture2D texture = Textures.GetTexture(Textures.Texture.marioSpriteSheet);

            isBig = false;

            Running = new Animation(texture, new Rectangle(81,0,16,16), 4, 0.08f, 4);
            Walking = new Animation(texture, new Rectangle(81,0,16,16), 4, 0.15f, 4);

            Standing = new Sprite(texture, new Rectangle(0, 0, 16, 16));
            Sliding = new Sprite(texture, new Rectangle(17, 0, 16, 16));
            Jumping = new Sprite(texture, new Rectangle(40, 0, 16, 16));
            Dying = new Sprite(texture, new Rectangle(60, 0, 16, 16));
            Crouching = new Sprite(texture, new Rectangle(61, 29, 16, 22));
            Firing = new Sprite(texture, new Rectangle(163, 55, 16, 32));

            velocity = Vector2.Zero;
            CurrentState = State.Standing;

            #if DEBUG
            BecomeBigMario();
            BecomeFireMario();
            #endif
        }