Exemple #1
0
 public void Execute()
 {
     SoundEffectFactory.Stomp();
     ((Mario)mario).ScoreEvent(enemy.ScoreData());
     enemy.TakeDamage(mario);
     ((Mario)mario).BounceOff();
 }
Exemple #2
0
 public void Execute()
 {
     SoundEffectFactory.PowerUp();
     superMushroom.setCollisionRectangle(new Rectangle(UtilityClass.zero, UtilityClass.zero, UtilityClass.zero, UtilityClass.zero));
     ((Mario)mario).BecomeBig();
     ((Mario)mario).stats.GotSuperMushroom();
 }
Exemple #3
0
 public void TakeDamage()
 {
     if (Small & !Star)
     {
         State.Dying();
     }
     else if (!Star)
     {
         takingDamage++;
         SoundEffectFactory.TransitionSmall();
         if (Fire)
         {
             Fire = false;
             BecomeBig();
         }
         else if (Ice)
         {
             Ice = false;
             BecomeBig();
         }
         else
         {
             Small = true;
             BecomeSmall();
         }
         actions.ReceivedDamage();
     }
 }
Exemple #4
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     BlockSpriteTextureStorage.Load(this.Content);
     ItemSpriteTextureStorage.Load(this.Content);
     EnemySpriteFactory.Load(this.Content);
     MiscGameObjectTextureStorage.Load(this.Content);
     MarioSpriteFactory.Load(this.Content);
     GUISpriteFactory.Load(this.Content);
     SoundEffectFactory.Load(this.Content);
     MusicFactory.Load(this.Content);
     background         = Content.Load <Texture2D>(UtilityClass.background);
     background2        = Content.Load <Texture2D>(UtilityClass.background2);
     skyworldbackground = Content.Load <Texture2D>("skyworldbackground");
     deathbackground    = Content.Load <Texture2D>(UtilityClass.deathbackground);
     font           = Content.Load <SpriteFont>(UtilityClass.FontString);
     basicarialfont = Content.Load <SpriteFont>(UtilityClass.BasicArialFontString);
     LoadKeyBoardCommands();
     levelStore       = loader.LoadLevel();
     mario            = levelStore.player;
     cameraController = new CameraController(camera, mario);
     resetCommand     = new ResetLevelCommand(this);
     MusicFactory.MainTheme();
     ResetGui();
 }
 public void Execute()
 {
     SoundEffectFactory.PowerUp();
     fireFlower.setCollisionRectangle(new Rectangle(UtilityClass.zero, UtilityClass.zero, UtilityClass.zero, UtilityClass.zero));
     ((Mario)mario).BecomeFire();
     ((Mario)mario).stats.GotFireFlower();
 }
 private void sendAboveGround(IPlayer mario, float elapsedtime, Camera camera)
 {
     if (hasbeguntransitionout == false)
     {
         SoundEffectFactory.Pipe();
     }
     hasbeguntransitionout = true;
     sendAboveGroundTransistion(mario, elapsedtime, camera);
 }
 private void sendUnderground(IPlayer mario, float elapsedtime)
 {
     if (((Mario)mario).StateStatus().Equals(MarioState.Duck) || hasbeguntransition == true)
     {
         AchievementEventTracker.undergroundAcievement();
         if (hasbeguntransition == false)
         {
             SoundEffectFactory.Pipe();
         }
         hasbeguntransition = true;
         sendUndergroundAnimation(mario, elapsedtime);
     }
 }
Exemple #8
0
 public Fireball(int x, int y, float spawnSpeed, bool facingRight, IPlayer shooter)
 {
     spawnGroundSpeed  = spawnSpeed;
     spawnGroundSpeed += facingRight ? UtilityClass.one : -UtilityClass.one;
     location          = new Vector2(x, y);
     sprite            = new FireballSprite(location);
     testForCollision  = true;
     timer             = UtilityClass.fireballTimer;
     rigidbody         = new AutonomousPhysicsObject();
     owner             = shooter;
     LoadRigidBodyProperties();
     SoundEffectFactory.Fireball();
     type = ProjectileType.Fireball;
 }
 public void Execute()
 {
     SoundEffectFactory.Kick();
     if (projectile.ReturnProjectileType().Equals(ProjectileType.Fireball))
     {
         ((Mario)((Fireball)projectile).GetOwner()).ProjectileScoreEvent(enemy.ScoreData());
         enemy.TakeDamage(((Mario)((Fireball)projectile).GetOwner()));
         ((Fireball)projectile).Killed();
     }
     else if (projectile.ReturnProjectileType().Equals(ProjectileType.Iceball))
     {
         ((Mario)((Iceball)projectile).GetOwner()).ProjectileScoreEvent(enemy.ScoreData());
         enemy.Freeze();
         ((Iceball)projectile).Killed();
     }
 }
 public void Execute()
 {
     if (game.returnCanPause())
     {
         if (!game.returnPause())
         {
             SoundEffectFactory.Pause();
             game.setPause(true);
             game.setCanPause(false);
         }
         else
         {
             game.setPause(false);
             game.setCanPause(false);
         }
     }
 }
Exemple #11
0
 public void Jump()
 {
     if (rigidbody.Floored && rigidbody.Velocity.Y < 0)
     {
         if (Small)
         {
             SoundEffectFactory.JumpSmall();
         }
         else
         {
             SoundEffectFactory.JumpBig();
         }
         actions.AddJump();
     }
     State.Jump();
     rigidbody.Jump();
 }
        public static void handleCollision(Mario mario, IBlock block, ICollision side, Game1 game)
        {
            if (!(side.returnCollisionSide().Equals(CollisionSide.None)) && !(block.returnBlockType().Equals(BlockType.Hidden)))
            {
                handleMarioMovement(mario, block, side);
            }
            else if (block.returnBlockType().Equals(BlockType.Hidden))
            {
                if (!(side.returnCollisionSide().Equals(CollisionSide.None)) && (block.checkForSpecalizedSideCollision()))
                {
                    handleMarioMovement(mario, block, side);
                }
            }

            if (side.returnCollisionSide().Equals(CollisionSide.Bottom))
            {
                SoundEffectFactory.Bump();
                executeCollisionCommand(mario, block, game);
                handleAchievements(block, mario);
            }
        }
Exemple #13
0
 public IItemObjects spawnOneUp()
 {
     SoundEffectFactory.Item();
     dispenseItemFlag = false;
     return(new OneUpMushroom((int)location.X, (int)location.Y - UtilityClass.itemOffSet));
 }
 public void smashBlock()
 {
     SoundEffectFactory.BrickBreak();
     ((BrickBlockSprite)sprite).hasSmashed();
 }
Exemple #15
0
 public MarioOneUpMushroomCollisionCommand(IPlayer mario, IItemObjects oneUpMushroom)
 {
     SoundEffectFactory.OneUp();
     player             = mario;
     this.oneUpMushroom = oneUpMushroom;
 }
Exemple #16
0
 public IItemObjects spawnStar()
 {
     SoundEffectFactory.Item();
     dispenseItemFlag = false;
     return(new SuperStar((int)location.X, (int)location.Y - UtilityClass.itemOffSet));
 }
 public void Execute()
 {
     SoundEffectFactory.PowerUp();
     iceFlower.setCollisionRectangle(new Rectangle(UtilityClass.zero, UtilityClass.zero, UtilityClass.zero, UtilityClass.zero));
     ((Mario)mario).BecomeIce();
 }
 public IItemObjects dispenseCoin()
 {
     SoundEffectFactory.Coin();
     return(new BoxCoin((int)location.X, (int)location.Y - UtilityClass.itemOffSet));
 }
Exemple #19
0
 public IItemObjects spawnCoin()
 {
     SoundEffectFactory.Coin();
     dispenseItemFlag = false;
     return(new BoxCoin((int)location.X, (int)location.Y - UtilityClass.itemOffSet));
 }
 public void Execute()
 {
     SoundEffectFactory.Coin();
     coin.setCollisionRectangle(new Rectangle(UtilityClass.zero, UtilityClass.zero, UtilityClass.zero, UtilityClass.zero));
     ((Mario)player).AddCoin();
 }
Exemple #21
0
 public void Update(Mario mario, float elapsedtime, Game1 game)
 {
     if (vine_box_hit)
     {
         if (vinegrowthtime > 1.5)
         {
             SoundEffectFactory.OneUp();
             IEnviromental GameObject = new SmallVine(355, 230);
             game.levelStore.enviromentalObjectsList.Add(GameObject);
             vinegrowthtime = vinegrowthtime - elapsedtime;
         }
         else if (vinegrowthtime > 1)
         {
             IEnviromental GameObject = new MediumVine(355, 140);
             game.levelStore.enviromentalObjectsList.Add(GameObject);
             vinegrowthtime = vinegrowthtime - elapsedtime;
         }
         else if (vinegrowthtime > .5)
         {
             IEnviromental GameObject = new LargeVine(355, 50);
             game.levelStore.enviromentalObjectsList.Add(GameObject);
             vinegrowthtime = vinegrowthtime - elapsedtime;
         }
         else if (vinegrowthtime > 0)
         {
             IEnviromental GameObject = new FullVine(355, -40);
             game.levelStore.enviromentalObjectsList.Add(GameObject);
             vinegrowthtime = vinegrowthtime - elapsedtime;
         }
         else
         {
             vine_box_hit    = false;
             vine_has_popped = true;
         }
     }
     if (vine_has_popped)
     {
         if (IsWithinSendSkyWorldBoundary(((Mario)mario).Location))
         {
             if (((Mario)mario).StateStatus().Equals(MarioState.Jump) || hasbeguntransition == true)
             {
                 if (hasbeguntransition == false)
                 {
                     SoundEffectFactory.Pipe();
                 }
                 hasbeguntransition = true;
                 SendToSkyWorld(mario, game);
             }
         }
     }
     if (IsWithinExitSkyWorldBoundary(((Mario)mario).Location))
     {
         if (((Mario)mario).StateStatus().Equals(MarioState.Duck) || hasbeguntransition == true)
         {
             if (hasbeguntransition == false)
             {
                 SoundEffectFactory.Pipe();
             }
             hasbeguntransition = true;
             SendFromSkyWorld(mario, elapsedtime, game);
         }
     }
 }