//************** FUNCTIONS ****************** public void updateGameWorld(ref Gameworld gameWorld, GameTime gameTime, InputHandler inputHandler) { getModelFromGameworld(gameWorld); //Change gamestate if (!(MediaPlayer.State == MediaState.Playing)) { MediaPlayer.Play(content.soundtrack); } elapsed = elapsed + gameTime.ElapsedGameTime.Milliseconds; Console.Out.WriteLine(gameTime.ElapsedGameTime.Milliseconds); if (elapsed > randomTimeBetweenSpawns) { randomTimeBetweenSpawns = randGen.Next(1, 3) * 1000; elapsed = 0; gameWorld.spawnEnemiesAtRandom(content); //Console.Out.WriteLine("RAAAAp"); } checkInput(gameTime, inputHandler, gameWorld); //gameWorld.updateEnemies(gameTime); handleProjectileCollisions(gameWorld); //updateGravityWell(gameWorld); //physicsEngine.collisionDetection(gameWorld); gameWorld.setPlayer(playerObject); gameWorld.update(gameTime, content); playSounds(); //return gameWorld; }
//************** FUNCTIONS ****************** public Gameworld updateGameWorld(Gameworld gameWorld, GameTime gameTime, InputHandler inputHandler) { getModelFromGameworld(gameWorld); //Change gamestate checkInput(gameTime, inputHandler, gameWorld); gameWorld.setPlayer(playerObject); return gameWorld; }