コード例 #1
0
 public Game()
 {
     speed   = 500;
     IsAlive = true;
     snake   = new Snake(10, 10, '*', ConsoleColor.Blue);
     food    = new Food(0, 0, '0', ConsoleColor.Red);
     wall    = new Wall('#', ConsoleColor.Yellow);
     wall.LoadLevel();
     food.Generate(snake, wall);
     g_objects = new List <GameObject>();
     g_objects.Add(snake);
     g_objects.Add(food);
     g_objects.Add(wall);
     Console.CursorVisible = false;
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: MirasK/Gunship
        public Game()
        {
            isAlive   = true;
            gameLevel = GameLevel.First;

            worm = new Worm(new Point {
                X = 10, Y = 10
            },
                            ConsoleColor.White, '*');
            food = new Food(new Point {
                X = 20, Y = 10
            },
                            ConsoleColor.White, '+');
            wall = new Wall(null, ConsoleColor.White, '#');

            wall.LoadLevel(GameLevel.First);

            g_objects.Add(worm);
            g_objects.Add(food);
            g_objects.Add(wall);
        }
コード例 #3
0
 public void Lvl2()
 {
     Console.Clear();
     //gameLevel = 2;
     wall.LoadLevel(2);
 }