예제 #1
0
 public static void WaterLoop()
 {
     while (Global.Run)
     {
         GameChecks.WaterFill();
     }
 }
예제 #2
0
        public static void GameLoop()
        {
            while (Global.Run)
            {
                while (Console.KeyAvailable)
                {
                    GameChecks.UserInput();

                    GameChecks.Gravity();

                    Thread.Sleep(Global.FrameDelay);

                    break;
                }
                GameChecks.Gravity();
            }
        }
예제 #3
0
        public static void TreePlacement()
        {
            int x = 0;

            while (x < Global.MapSize * Global.Width)
            {
                bool OnGround = false;

                int y = 0;

                x += Global.rnd.Next(5, 25);

                while (!OnGround)
                {
                    try
                    {
                        if (GameChecks.IsSolid(Global.MapData[x, y + 1]) == true)
                        {
                            for (int i = 0; i < Global.rnd.Next(5, 7); i++)
                            {
                                if (y <= 2)
                                {
                                    Bush(x, y);
                                    break;
                                }
                                Global.MapData[x, y] = 6;
                                y -= 1;
                            }
                            OnGround = true;
                            Bush(x, y);
                            break;
                        }
                        else
                        {
                            y += 1;
                        }
                    }
                    catch
                    {
                        break;
                    }
                }
            }
        }