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

            Game.Run(100);
            Console.ReadLine();
        }
Example #3
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SnakeGame game = new SnakeGame())
     {
         game.Run();
     }
 }
Example #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
        }
Example #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
        }
        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();
        }
Example #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
        }
Example #8
0
 public static void Main()
 {
     snakeGame = new SnakeGame();
     snakeGame.Run();
 }
Example #9
0
 static void Main()
 {
     using (var game = new SnakeGame())
         game.Run();
 }
Example #10
0
 public static void Main()
 {
     snakeGame = new SnakeGame();
     snakeGame.Run();
 }