45 lines
		
	
	
		
			915 B
		
	
	
	
		
			C++
		
	
	
	
	
	
		
		
			
		
	
	
			45 lines
		
	
	
		
			915 B
		
	
	
	
		
			C++
		
	
	
	
	
	
|  | #include <cstdlib>
 | ||
|  | #include <iostream>
 | ||
|  | 
 | ||
|  | #include "Engine.h"
 | ||
|  | 
 | ||
|  | #include "Controller.h"
 | ||
|  | #include "View.h"
 | ||
|  | #include "Model.h"
 | ||
|  | #include "Physics.h"
 | ||
|  | #include "EntityFactory.h"
 | ||
|  | 
 | ||
|  | using namespace std; | ||
|  | 
 | ||
|  | int main (int argc, char* argv[]) { | ||
|  | 	cout << "Game Start" << endl; | ||
|  | 	 | ||
|  | 	Engine::Engine engine; | ||
|  | 
 | ||
|  | 	engine.SetEntityFactory (new asteroids::EntityFactory); | ||
|  | 	engine.SetController (new asteroids::Controller); | ||
|  | 	engine.SetModel (new asteroids::Model); | ||
|  | 	engine.SetPhysics (new asteroids::Physics); | ||
|  | 	engine.SetView (new asteroids::View); | ||
|  | 
 | ||
|  | 	SetLogPrintLevel (Engine::LogLevelDebug); | ||
|  | 
 | ||
|  | 	if (engine.Init (argc, argv) != 0) { | ||
|  | 		cout << "Could not start engine!" << endl; | ||
|  | 		exit (-1); | ||
|  | 	} | ||
|  | 
 | ||
|  | 	engine.GetView()->SetGridSize (8,8); | ||
|  | 	dynamic_cast<asteroids::Physics*>(engine.GetPhysics())->SetWorldSize (28, 20); | ||
|  | 
 | ||
|  | 	SetLogPrintLevel (Engine::LogLevelDebug); | ||
|  | 
 | ||
|  | 	engine.MainLoop (); | ||
|  | 
 | ||
|  | 	engine.Destroy (); | ||
|  | 
 | ||
|  | 	cout << "Game Quit" << endl; | ||
|  | 
 | ||
|  | 	return 0; | ||
|  | } |