Exemple #1
0
 public void ToungeGrabbed(Entity e)
 {
     e.forRemoval = true;
     if (e.GetType() == typeof(Pickup))
     {
         Pickup p = (Pickup)e;
         if (p.pType == Pickup.PickupType.HoloFrog)
         {
             if (teamCount < maxTeamCount)
             {
                 Frog newFrog = new Frog(p.x, p.y);
                 EntityManager.AddEntity(newFrog);
                 EntityManager.AddEntity(new Popup(Popup.PopupType.NewFrog, x + 2, y - 4));
                 teamCount++;
             }
         }
         if (p.pType == Pickup.PickupType.Coin)
         {
             points++;
         }
     }
 }
Exemple #2
0
 private void InitializeMiddle()
 {
     State[n] = Frog.Empty();
 }
Exemple #3
0
        private static void StartNewGame(int lives)
        {
            Console.Clear();

            // Print demarkations
            string demark = ">";
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.SetCursorPosition(0, 15);
            for (int i = 0; i <= RoadCols / demark.Length; i++)
                Console.Write(demark);
            Console.SetCursorPosition(0, 18);
            for (int i = 0; i <= RoadCols / demark.Length; i++)
                Console.Write(demark);
            Console.ResetColor();

            // Initialize variables
            gameClock = Stopwatch.StartNew();
            rand = new Random();
            lastRefresh = gameClock.ElapsedMilliseconds;

            // List of available colors
            colors = new ConsoleColor[] {
                ConsoleColor.Cyan,
                ConsoleColor.Magenta,
                ConsoleColor.Red,
                ConsoleColor.Yellow,
            };

            // Create objects
            CreateLanes();
            lanesPopulated = false;
            frog = new Frog();
            life = lives;
            gameState = GameState.Running;
        }