예제 #1
0
 public void Left(Mario mario)
 {
     if (!mario.Parameters.IsLeft)
     {
         mario.ChangeToIdle();
     }
 }
예제 #2
0
 public void CollideWithEnemy(bool isTop, ICharacter character)
 {
     /*
      * if Mario collide enemy from left, right or hit enemy's bottom, Mario is destroyed
      * If the enemy is a plant enemy, no matter which point Mario collides with, Mario is destroyed
      */
     if (!isTop || character is PlantEnemyCharacter || character is CloudEnemyCharacter)
     {
         Mario.MarioState.Destroy();
         if (Mario.MarioState.GetPowerType != MarioState.PowerType.Died)// if Mario is still alive
         {
             ChangeToStarState(15);
         }
     }
     if (character is BossEnemyCharacter)
     {
         Mario.MarioState.ChangeToDied();
     }
     if (Mario.MarioState.GetPowerType != MarioState.PowerType.Died)
     {
         Mario.ChangeToIdle();
     }
 }
예제 #3
0
 public void Return(Mario mario)
 {
     mario.ChangeToIdle();
 }
예제 #4
0
 public void Up(Mario mario)
 {
     mario.ChangeToIdle();
 }                                                     // only Super and Fire can call this method
예제 #5
0
 public void Leave(Mario mario)
 {
     mario.ChangeToIdle();
 }