Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        public AIManager(Physics.Player aTargetPlayer, float width, float height)
        {
            windowHeight = height;
            windowWidth  = width;

            numberGenerator = new Random();
            aiControllers   = new List <AI.AIEngine>();
            targetPlayer    = aTargetPlayer;

            physEng        = Physics.PhysicsEngine.GetPhysicsEngine();
            aiGraphManager = AI.WorldGraph.GetWorldGraph();

            AISpawnLocations = new List <Physics.Vector2D>();

            timeSinceLastSpawn = 0.0f;
            lastSpawnPoint     = 0;
        }
Exemplo n.º 3
0
        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;
        }