public Scene() { //initialise the physics engine and the AI graph singletons (this is the first initialisation of both) thePhysicsEngine = Physics.PhysicsEngine.GetPhysicsEngine(); AIGraph = AI.WorldGraph.GetWorldGraph(); //create the rigidbodies that make up the game world CreateObjects(); //Create the player thePlayer = new Physics.Player(20.0f, 15000); thePlayer.playerBody.SetPosition(new Physics.Vector2D(0, 620)); thePlayer.playerBody.Shape.mColor = System.Drawing.Color.Blue; thePhysicsEngine.addRigidBody(thePlayer.playerBody); thePhysicsEngine.playerCharacter = thePlayer; //create the AI manager theAIManager = new AI.AIManager(thePlayer, GlobalConstants.WINDOW_WIDTH, GlobalConstants.WINDOW_HEIGHT); //add the hardcoded AI spawn points CreateAISpawnLocations(); //use the current level's rigidbodies to generate the nodes and connections of the AI graph AIGraph.PopulateGraph(thePhysicsEngine); headsUpDisplay = new UI(); currentState = GAMESTATE.RUNNING; }
/// <summary> /// Initializes a new instance of the <see cref="LevelScene"/> class. /// </summary> /// <param name="game"> /// The game instance. /// </param> public LevelScene(Game game) : base(game) { this.currentLevel = new Level(true); ObjectManager.SetUpLists(this.ID); this.background = new Background(this); this.Camera = new Camera(this.Game, new Vector3(0.0f, 0.0f, 30.0f)) { FieldOfView = 70.0f }; this.aiManager = new AI.AIManager(this.Game); }
public DebugDisplay(Physics.Player thePlayer, AI.AIManager aManager, SimpleRenderer aRender) { //get references to the useful game classes playerCharacter = thePlayer; mAImanager = aManager; physEng = Physics.PhysicsEngine.GetPhysicsEngine(); AIgraph = AI.WorldGraph.GetWorldGraph(); mRenderer = aRender; //initialise the bools showCurrentPlayerJump = false; showNodes = false; showPath = false; showJumpRange = false; showFallRange = false; showJumpBoxCollisions = false; showFallBoxCollisions = false; showCollisionNormals = false; showLocalNodes = -1; jumpDestination = null; }