예제 #1
0
 static void Main()
 {
     using (var game = new SnakeGame())
     {
         game.Run();
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            SnakeGame Game = new SnakeGame(40, 20);

            Game.Run(100);
            Console.ReadLine();
        }
예제 #3
0
파일: Program.cs 프로젝트: Zviada/Snake
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SnakeGame game = new SnakeGame())
     {
         game.Run();
     }
 }
예제 #4
0
        static void Main(string[] args)
        {
#if !MACOS
            Game = new SnakeGame();
            Game.Run();
#else
				NSApplication.Init ();
				using (var p = new NSAutoreleasePool ()) {
					NSApplication.SharedApplication.Delegate = new AppDelegate ();
					NSApplication.Main (args);
				}
#endif
        }
예제 #5
0
        static void Main(string[] args)
        {
#if !MACOS
            Game = new SnakeGame();
            Game.Run();
#else
            NSApplication.Init();
            using (var p = new NSAutoreleasePool()) {
                NSApplication.SharedApplication.Delegate = new AppDelegate();
                NSApplication.Main(args);
            }
#endif
        }
예제 #6
0
        static void Main()
        {
            // AI Controller
            var neuralNetwork = NeuralNetwork.CreateFromFile(SnakeNeuralNetworkSpecification.Specification, @"Content\snakeWeights.json");
            var aiController  = new SnakeAiController(1, neuralNetwork);

            // Keyboard Controller
            var keyboardController = new SnakeKeyboardController(1);

            // Change value of selectedController to play game with keyboard
            var selectedController = aiController;

            using (var game = new SnakeGame(new List <ISnakeController> {
                selectedController
            }))
                game.Run();
        }
예제 #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            this.MakeFullScreen();

            View game_view;

            if (MainActivity.Game == null)
            {
                SnakeGame.Vibrator = (Vibrator)this.ApplicationContext.GetSystemService(Context.VibratorService);
                var g = new SnakeGame();
                game_view    = (View)g.Services.GetService(typeof(View));
                g.ExitEvent += () => this.MoveTaskToBack(true);
                g.Run();

                MainActivity.Game = g;
            }
            else
            {
                game_view = (View)MainActivity.Game.Services.GetService(typeof(View));
                ViewGroup parent = (ViewGroup)game_view.Parent;
                if (parent != null)
                {
                    parent.RemoveView(game_view);
                }
            }

#if ADS
            var layout = new FrameLayout(this);
            layout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            layout.AddView(game_view);
            SetContentView(layout);
            AndroidAds.Context   = this;
            AndroidAds.ViewGroup = layout;
#else
            this.SetContentView(game_view);
#endif
        }
예제 #8
0
파일: Program.cs 프로젝트: Wampa/AsciiSnake
 public static void Main()
 {
     snakeGame = new SnakeGame();
     snakeGame.Run();
 }
예제 #9
0
파일: Program.cs 프로젝트: SysVoid/Snake
 static void Main()
 {
     using (var game = new SnakeGame())
         game.Run();
 }
예제 #10
0
 public static void Main()
 {
     snakeGame = new SnakeGame();
     snakeGame.Run();
 }