Exemplo n.º 1
0
 public void doYourThing(Player player)
 {
     switch (type)
     {
         case PowerUpType.HoleSize:
             HoleManager.cangeAllHolesSize();
             break;
         case PowerUpType.HolePos:
             HoleManager.changeAllHolesPlace();
             break;
         case PowerUpType.BiggerPlayerSize:
             player.changeSizeBig();
             break;
         case PowerUpType.SmallerPlayerSize:
             player.changeSizeSmall();
             break;
         case PowerUpType.SplitPlayer:
             Vector3 temp = player.getCenter();
             player.changePlayerType("duplicate", new Vector2(temp.X,temp.Z));
             break;
         case PowerUpType.NormalPlayer:
             player.changeAllStatic();
             break;
         case PowerUpType.ChangeFolds:
             GameManager.changeFolds();
             break;
         case PowerUpType.ExtraTime:
             GameManager.changeTime();
             break;
     }
 }
Exemplo n.º 2
0
 public void doYourThing(Player player)
 {
     switch (type)
     {
         // V
         case PowerUpType.HoleSize:
             HoleManager.cangeAllHolesSize();
             break;
         // V
         case PowerUpType.HolePos:
             HoleManager.changeAllHolesPlace();
             break;
         // V
         case PowerUpType.PlayerSize:
             player.changeSize();
             break;
         // V
         case PowerUpType.PlayerPos:
             player.changePos(new Random().Next(-25, 25));
             break;
         case PowerUpType.SplitPlayer:
             player.changePlayerType("duplicate", (int)worldPosition.X, (int)worldPosition.Y);
             break;
         case PowerUpType.DryPlayer:
             player.changePlayerType("static", (int)worldPosition.X, (int)worldPosition.Y);
             break;
         case PowerUpType.NormalPlayer:
             player.changePlayerType("normal", (int)worldPosition.X, (int)worldPosition.Y);
             break;
     }
 }
Exemplo n.º 3
0
 public void changePlayerType(Player p,String type, Vector2 center,bool fromDup)
 {
     if (players.Contains(p))
     {
         players.Remove(p);
         makeNewPlayer(type, center, fromDup);
     }
     else Trace.WriteLine("changePlayerType Error!");
 }
Exemplo n.º 4
0
 /* public void foldOver()
 {
     foreach (Player p in players)
     {
         p.foldOver();
     }
 }*/
 public void changePlayerType(Player p,String type, int x, int y)
 {
     if (players.Contains(p))
     {
         //players.Add(makeNewPlayer(type, x, y));
         players.Remove(p);
     }
     else Trace.WriteLine("changePlayerType Error!");
 }
Exemplo n.º 5
0
        public static bool isStillInacid(Player player, Vector2 pCenter, float pSize)
        {
            foreach (Acid a in acids)
            {
                if (Vector2.Distance(pCenter, a.center) < (pSize + a.size - 0.5))
                {
                    return true;
                }
            }

            return false;
        }
Exemplo n.º 6
0
 public static bool checkCollision(Player player, Vector2 pCenter, float pSize)
 {
     foreach (Acid a in acids)
     {
         if (Vector2.Distance(pCenter, a.center) < (pSize + a.size - 0.5))
         {
             Trace.WriteLine("Lose!!!!!!");
             GameManager.loseLevel();
             return true;
         }
     }
     return false;
 }
Exemplo n.º 7
0
 public static void checkCollision(Player player, Vector2 pCenter, float pSize)
 {
     PowerUp pToRemove = null;
     foreach (PowerUp p in powerups)
     {
         if (Vector2.Distance(pCenter, p.center) < (pSize + p.size))
         {
             GameManager.showPuMsg = true;
             p.doYourThing(player);
             pToRemove = p;
             break;
         }
     }
     if (pToRemove!=null)
         powerups.Remove(pToRemove);
 }
Exemplo n.º 8
0
 public static void checkCollision(Player player)
 {
     foreach (Hole h in holes)
     {
         BoundingBox b1 = h.getBox();
         b1.Max.X -= 1.0f;
         b1.Max.Z -= 1.0f;
         b1.Min.X += 1.0f;
         b1.Min.Z += 1.0f;
         BoundingBox b2 = player.getBox();
         if (b1.Intersects(b2))
         {
             // WIN!!!
             Trace.WriteLine("WIN!!!!!!");
             GameManager.winLevel();
             break;
         }
     }
 }
Exemplo n.º 9
0
 public static void checkCollision(Player player)
 {
     PowerUp pToRemove = null;
     foreach (PowerUp p in powerups)
     {
         BoundingBox b1 = p.getBox();
         b1.Max.X -= 1.0f;
         b1.Max.Z -= 1.0f;
         b1.Min.X += 1.0f;
         b1.Min.Z += 1.0f;
         BoundingBox b2 = player.getBox();
         if (b1.Intersects(b2))
         {
             p.doYourThing(player);
             pToRemove = p;
             break;
         }
     }
     if (pToRemove!=null)
         powerups.Remove(pToRemove);
 }
Exemplo n.º 10
0
 public static bool checkCollision(Player player,Vector2 pCenter,float pSize, int numOfPlayers)
 {
     foreach (Hole h in holes)
     {
         if (Vector2.Distance(pCenter, h.center) < (pSize + h.size - 0.5))
         {
             GameManager.showHoleMsg = true;
             if (GameManager.level != 3)
             {
                 collisionCount++;
                 if (collisionCount >= numOfPlayers)
                 {
                     // WIN!!!
                     Trace.WriteLine("WIN!!!!!!");
                     GameManager.winLevel();
                 }
             }
             return true;
         }
     }
     return false;
 }
Exemplo n.º 11
0
        public static bool isStillInHole(Player player,Vector2 pCenter,float pSize)
        {
            foreach (Hole h in holes)
            {
                if (Vector2.Distance(pCenter, h.center) < (pSize + h.size - 0.5))
                {
                    return true;
                }
            }

            return false;
        }