Example #1
0
 static void Main()
 {
     using (var game = new GameTest())
     {
         InitService(game);
         InitScenes(game);
         game.Run();
     }
 }
Example #2
0
 private static void InitScenes(GameTest game)
 {
     //register scenes
     SceneManager manager = game.Services.GetService<SceneManager>();
     manager.Register<InputTestScene>();
     manager.Register<AudioTestScene>();
     manager.Register<GuiTestScene>();
     manager.Register<PhysicsTestScene>();
     manager.Register<UtilityTestScene>();
 }
Example #3
0
 private static void InitService(GameTest game)
 {
     //register services
     game.Content.RootDirectory = "Content";
     game.Services.AddService<ContentManager>(game.Content);
     game.Services.AddService<SettingsManager>(new SettingsManager(game));
     game.Services.AddService<SceneManager>(new SceneManager(game));
     game.Services.AddService<SongManager>(new SongManager(game));
     game.Services.AddService<SoundManager>(new SoundManager(game));
     game.Services.AddService<KeyboardManager>(new KeyboardManager(game));
     game.Services.AddService<MouseManager>(new MouseManager(game));
     game.Services.AddService<GamepadManager>(new GamepadManager(game));
     game.Services.AddService<Collision2DManager>(new Collision2DManager(game));
     game.Services.AddService<GravityManager>(new GravityManager(game));
 }