Esempio n. 1
0
 public Peach(ContentManager content, GraphicsDevice graphicsDevice)
 {
     Content             = content;
     graphics            = graphicsDevice;
     StandardSpriteSheet = content.Load <Texture2D>("Peach/StandardPeachSpriteSheet");
     FireSpriteSheet     = content.Load <Texture2D>("Peach/FirePeachSpriteSheet");
     SuperSpriteSheet    = content.Load <Texture2D>("Peach/SuperPeachSpriteSheet");
     StarSpriteSheet     = content.Load <Texture2D>("Peach/StarPeachSpriteSheet");
     fireBallPink        = content.Load <Texture2D>("FireBallPink");
     fireBallStar        = content.Load <Texture2D>("FireBallStar");
     fireBall            = content.Load <Texture2D>("FireBall");
     KillGoomba          = content.Load <SoundEffect>("Sound Effects/Stomp");
     Sprite = new AvatarSprite(graphicsDevice);
     Sprite.InitializeSprite(StandardSpriteSheet, graphicsDevice, 6, 6);
     Sprite.SwitchAnimation(Constants.ZERO, 6);
     PowerUpState             = new StandardState(new StandardState(null));
     Checkable                = true;
     ActionState              = new IdleState(this);
     Sprite.Acceleration      = new Vector2(Constants.ZERO, G);
     OnGround                 = true;
     frameCountA.frames       = 100; // invincibility ~ 1.5 s @ 60 fps
     frameCountA.currentFrame = Constants.ZERO;
     frameCountA.enabled      = false;
     Invincible               = false;
 }
Esempio n. 2
0
        private ISprite MakeAvatarSprite(ContentManager content, GraphicsDevice graphics)
        {
            ISprite   sprite;
            Texture2D avatar = content.Load <Texture2D>("Peach/StandardPeachSpriteSheet");

            sprite = new AvatarSprite(graphics);
            sprite.InitializeSprite(avatar, graphics, 6, 6);
            sprite.SwitchAnimation(Constants.ZERO, 6);
            sprite.ScaleSprite(0.39f);
            sprite.CurrentLocation = new Vector2(TopLeft.X + 140, -5);

            return(sprite);
        }
Esempio n. 3
0
 public AABB BoundingBox()
 {
     if (PowerUpState is StandardState || ActionState is CrouchingState)
     {
         AvatarSprite peachSprite = (AvatarSprite)Sprite;
         return(new AABB {
             X = Sprite.CurrentLocation.X + 25, Y = Sprite.CurrentLocation.Y + 28, Width = peachSprite.Scale * 45, Height = peachSprite.Scale * 80 - 10
         });
     }
     else
     {
         AvatarSprite peachSprite = (AvatarSprite)Sprite;
         return(new AABB {
             X = Sprite.CurrentLocation.X + 25, Y = Sprite.CurrentLocation.Y + 18, Width = peachSprite.Scale * 45, Height = peachSprite.Scale * 80
         });
     }
 }