Example #1
0
		public UI(Window window, Game game)
		{
			this.window = window;
			this.game = game;
			new Command(window.CloseAfterFrame).Add(new KeyTrigger(Key.Escape, State.Pressed));
			new Command(() => window.SetFullscreen(new Size(1920, 1080))).Add(new KeyTrigger(Key.F));
		}
Example #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game game = new Game())
     {
         game.Run();
     }
 }
Example #3
0
		static int Main ( string[] args )
		{
			// 	colored console output :
			Log.AddListener( new ColoredLogListener() );
			
			//	output for in-game console :
			Log.AddListener( new LogRecorder() );

			//	set verbosity :
			Log.VerbosityLevel	=	LogMessageType.Verbose;


			//
			//	Build content on startup.
			//	Remove this line in release code.
			//
			Builder.Options.InputDirectory	=	@"..\..\..\Content";
			Builder.Options.TempDirectory	=	@"..\..\..\Temp";
			Builder.Options.OutputDirectory	=	@"Content";
			Builder.SafeBuild();


			//
			//	Run game :
			//
			using ( var game = new Game("$safeprojectname$") ) {

				//	create SV, CL and UI instances :
				game.GameServer		=	new $safeprojectname$Server(game);
				game.GameClient		=	new $safeprojectname$Client(game);
				game.GameInterface	=	new $safeprojectname$Interface(game);

				//	load configuration.
				//	first run will cause warning, 
				//	because configuration file still does not exist.
				game.LoadConfiguration("Config.ini");

				//	enable and disable debug direct3d device :
				game.RenderSystem.Config.UseDebugDevice =	false;

				//	enable and disable object tracking :
				game.TrackObjects	= true;

				//	set game title :
				game.GameTitle = "$safeprojectname$";

				//	apply command-line options here:
				//	...

				//	run:
				game.Run();
				
				//	save configuration :
				game.SaveConfiguration("Config.ini"); 				
			}

			return 0;
		}
		/// <summary>
		/// Creates instance of $safeprojectname$Interface
		/// </summary>
		/// <param name="engine"></param>
		public $safeprojectname$Interface ( Game game ) : base(game)
Example #5
0
		public Controls(Game game)
		{
			this.game = game;
			controlCommands = new Command[6];
			commandsInUse = 0;
		}
		/// <summary>
		/// Ctor
		/// </summary>
		/// <param name="engine"></param>
		public $safeprojectname$Client ( Game game )	: base(game)
		/// <summary>
		/// Ctor
		/// </summary>
		/// <param name="engine"></param>
		public $safeprojectname$Server ( Game game ) : base(game)