コード例 #1
0
 public void Execute()
 {
     if (side.TopOrLeft is Fireball)
     {
         Fireball fb = (Fireball)side.TopOrLeft;
         fb.collisionEnemy = true;
         goomba.BeFlipped();
         Game.st.DefeatGoomba();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Goomba, goomba.Location);
     }
     else if (side.BottomOrRight is Fireball)
     {
         Fireball fb = (Fireball)side.BottomOrRight;
         fb.collisionEnemy = true;
         goomba.BeFlipped();
         Game.st.DefeatGoomba();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Goomba, goomba.Location);
     }
     else
     {
         goomba.Physics.YVelocity = 0;
         MoveGoomba();
     }
 }
コード例 #2
0
        public void Execute()
        {
            Mario.marioCanTransition         = false;
            Mario.marioCanTransitionLeftPipe = false;
            if (Mario is StarMario)
            {
                Koopa.KillKoopa();
            }
            else
            {
                if (!Koopa.Physics.IsMovingX() && Koopa.Health == KoopaStateMachine.KoopaHealth.Shelled)
                {
                    MarioSoundBoard.Instance.PlayMarioKick();
                    Koopa.Physics.XVelocity = Koopa.Physics.XMinVelocity;
                }
                else
                {
                    Koopa.BeShelled();
                    MarioSoundBoard.Instance.PlayMarioStomp();
                }
                Mario.SetPosition(new Vector2(Mario.Location.X, Mario.Location.Y
                                              - Side.Collision.Height));
                Mario.Physics.YVelocity = PhysicsUtilites.PlayerBumpVelocityY;
            }

            Game.RumbleHelper.Rumble(PlayerIndex.One, Game.RumbleHelper.LowRumble, Game.RumbleHelper.LowRumble, Game.RumbleHelper.QuickRumble);
            Game.st.KoopaStomp();
            ScoreAssignments sa = new ScoreAssignments();

            Game.UI.DisplayScore(sa.KoopaStomp, Koopa.Location);
        }
コード例 #3
0
        public void Execute()
        {
            FireFlower.BeRemoved = true;
            Mario.SetFire();
            Game.st.PowerUp();
            ScoreAssignments sa = new ScoreAssignments();

            Game.UI.DisplayScore(sa.PowerUp, FireFlower.Location);
        }
コード例 #4
0
 public void Execute()
 {
     if (Koopa.Health == KoopaStateMachine.KoopaHealth.Shelled && Koopa.Physics.IsMovingX())
     {
         Goomba.BeFlipped();
         Game.st.KoopaFire();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.KoopaFire, Goomba.Location);
     }
     StackEnemies();
 }
コード例 #5
0
 public void Execute()
 {
     Mushroom.BeRemoved = true;
     if (Mario.Size() != MarioStateMachine.MarioSize.Fire)
     {
         Mario.SetBig();
         Game.st.PowerUp();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.PowerUp, Mushroom.Location);
     }
 }
コード例 #6
0
 public void Execute()
 {
     if (block.State.BumpingBlock)
     {
         koopa.KillKoopa();
         Game.st.KoopaStomp();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.KoopaStomp, koopa.Location);
         return;
     }
     koopa.Physics.YVelocity = 0;
     MoveKoopa();
 }
コード例 #7
0
 public void Execute()
 {
     if (block.State.BumpingBlock)
     {
         goomba.BeFlipped();
         Game.st.DefeatGoomba();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Goomba, goomba.Location);
         return;
     }
     goomba.Physics.YVelocity = 0;
     MoveGoomba();
 }
コード例 #8
0
 public void Execute()
 {
     if (Koopa.Health == KoopaStateMachine.KoopaHealth.Shelled && Koopa.Physics.IsMovingX())
     {
         Goomba.BeFlipped();
         Game.st.DefeatGoomba();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Goomba, Goomba.Location);
     }
     else
     {
         MoveEnemies();
         Koopa.ChangeDirection();
         Goomba.ChangeDirection();
     }
 }
コード例 #9
0
 public void Execute()
 {
     Mario.marioCanTransition         = false;
     Mario.marioCanTransitionLeftPipe = false;
     if (Mario is StarMario)
     {
         Pirana.KillPirana();
         Game.st.PiranaFire();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Pirana, Pirana.Location);
         Game.RumbleHelper.Rumble(PlayerIndex.One, Game.RumbleHelper.LowRumble, Game.RumbleHelper.LowRumble, Game.RumbleHelper.QuickRumble);
     }
     else
     {
         Mario.TakeDamage();
         Game.RumbleHelper.Rumble(PlayerIndex.One, Game.RumbleHelper.MidRumble, Game.RumbleHelper.MidRumble, Game.RumbleHelper.ShortRumble);
     }
 }
コード例 #10
0
 public void Execute()
 {
     Mario.marioCanTransition         = false;
     Mario.marioCanTransitionLeftPipe = false;
     if (Mario is StarMario)
     {
         Goomba.BeFlipped();
         Game.st.DefeatGoomba();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Goomba, Goomba.Location);
         Game.RumbleHelper.Rumble(PlayerIndex.One, Game.RumbleHelper.LowRumble, Game.RumbleHelper.LowRumble, Game.RumbleHelper.QuickRumble);
     }
     else
     {
         Mario.TakeDamage();
         Game.RumbleHelper.Rumble(PlayerIndex.One, Game.RumbleHelper.MidRumble, Game.RumbleHelper.MidRumble, Game.RumbleHelper.ShortRumble);
     }
 }
コード例 #11
0
 private bool checkForDeadKoopa()
 {
     if (deadlyShell(koopaOne) && !deadlyShell(koopaTwo))
     {
         koopaTwo.KillKoopa();
         Game.st.KoopaStomp();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.KoopaStomp, koopaTwo.Location);
         return(true);
     }
     else if (deadlyShell(koopaTwo) && !deadlyShell(koopaOne))
     {
         koopaOne.KillKoopa();
         Game.st.KoopaStomp();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.KoopaStomp, koopaOne.Location);
         return(true);
     }
     return(false);
 }
コード例 #12
0
 public void Execute()
 {
     if (side.TopOrLeft is Fireball)
     {
         Fireball fb = (Fireball)side.TopOrLeft;
         fb.collisionEnemy = true;
         pirana.KillPirana();
         Game.st.DefeatGoomba();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Pirana, pirana.Location);
     }
     else if (side.BottomOrRight is Fireball)
     {
         Fireball fb = (Fireball)side.BottomOrRight;
         fb.collisionEnemy = true;
         pirana.KillPirana();
         Game.st.DefeatGoomba();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.Pirana, pirana.Location);
     }
 }
コード例 #13
0
        private void CreateBlockExplosion()
        {
            ItemBlockSoundBoard.Instance.PlayBlockBreak();
            Block.BeRemoved = true;
            Game.st.BreakBlock();
            ScoreAssignments sa = new ScoreAssignments();

            Game.UI.DisplayScore(sa.BrickBlock, Block.Location);
            BlockExplosionPiece piece1 = (BlockExplosionPiece)ObjectSpriteFactory.Instance.GetBlockExplosion(Block.Location, Block.Color);
            BlockExplosionPiece piece2 = (BlockExplosionPiece)ObjectSpriteFactory.Instance.GetBlockExplosion(Block.Location, Block.Color);
            BlockExplosionPiece piece3 = (BlockExplosionPiece)ObjectSpriteFactory.Instance.GetBlockExplosion(Block.Location, Block.Color);
            BlockExplosionPiece piece4 = (BlockExplosionPiece)ObjectSpriteFactory.Instance.GetBlockExplosion(Block.Location, Block.Color);

            piece1.ExplodeTopLeft();
            piece2.ExplodeTopRight();
            piece3.ExplodeBottomLeft();
            piece4.ExplodeBottomRight();
            Game.backGround.Add(piece1);
            Game.backGround.Add(piece2);
            Game.backGround.Add(piece3);
            Game.backGround.Add(piece4);
        }
コード例 #14
0
        public void Execute()
        {
            Mario.marioCanTransition         = false;
            Mario.marioCanTransitionLeftPipe = false;
            if (Mario is StarMario)
            {
                Goomba.BeFlipped();
            }
            else
            {
                Mario.SetPosition(new Vector2(Mario.Location.X, Mario.Location.Y
                                              - Side.Collision.Height));
                MarioSoundBoard.Instance.PlayMarioStomp();
                Mario.Physics.YVelocity = PhysicsUtilites.PlayerBumpVelocityY;
                Goomba.BeStomped();
            }

            Game.RumbleHelper.Rumble(PlayerIndex.One, Game.RumbleHelper.LowRumble, Game.RumbleHelper.LowRumble, Game.RumbleHelper.QuickRumble);
            Game.st.DefeatGoomba();
            ScoreAssignments sa = new ScoreAssignments();

            Game.UI.DisplayScore(sa.Goomba, Goomba.Location);
        }
コード例 #15
0
 public void Execute()
 {
     if (side.TopOrLeft is Fireball)
     {
         Fireball fb = (Fireball)side.TopOrLeft;
         fb.collisionEnemy = true;
         koopa.KillKoopa();
         Game.st.KoopaFire();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.KoopaFire, koopa.Location);
     }
     else if (side.BottomOrRight is Fireball)
     {
         Fireball fb = (Fireball)side.BottomOrRight;
         fb.collisionEnemy = true;
         koopa.KillKoopa();
         Game.st.KoopaFire();
         ScoreAssignments sa = new ScoreAssignments();
         Game.UI.DisplayScore(sa.KoopaFire, koopa.Location);
     }
     koopa.Physics.YVelocity = 0;
     Movekoopa();
 }