Example #1
0
        static void Main(string[] args)
        {
            Console.CursorVisible = false;
            try
            {
                var eventLoop = new EventLoop();
                var game      = new Game("map.txt");

                eventLoop.LeftHandler  += game.OnLeft;
                eventLoop.RightHandler += game.OnRight;
                eventLoop.UpHandler    += game.Up;
                eventLoop.DownHandler  += game.Down;

                eventLoop.Run();
            }
            catch (FileNotFoundException)
            {
                Console.WriteLine("Map file not found");
            }
        }
Example #2
0
        static void Main()
        {
            try
            {
                var game      = new Game("Map.txt");
                var eventLoop = new EventLoop();

                eventLoop.LeftHandler  += game.OnLeft;
                eventLoop.RightHandler += game.OnRight;
                eventLoop.TopHandler   += game.OnTop;
                eventLoop.DownHandler  += game.OnDown;

                eventLoop.Run();
            }
            catch (FileNotFoundException exception)
            {
                Console.WriteLine(exception.Message);
            }
            catch (IncorrectMapException exception)
            {
                Console.WriteLine(exception.Message);
            }
        }