SpriteBatch sb; //The sprite batch, used to draw things. #endregion Fields #region Constructors /// <summary> /// Constructor. /// </summary> /// <param name="sb">The sprite batch</param> /// <param name="c">The content manager</param> public GameState(SpriteBatch sb, ContentManager c) { GameTime time = new GameTime(); controller = new Controller(); doPack = new doPacket(this, time, controller); drawPack = new drawPacket(this, time, sb); content = c; gameWorld = new RenderTarget2D(sb.GraphicsDevice, 1280, 720); effects = new RenderTarget2D(sb.GraphicsDevice, 1280, 720); UI = new RenderTarget2D(sb.GraphicsDevice, 1280, 720); pauseBG = new RenderTarget2D(sb.GraphicsDevice, 1280, 720); exitGame = false; playerPosition = new CollisionPoint(); cameraPosition = new Point(); paused = false; frameCaptured = false; }
public GameTime time; //The GameTime, which includes the time since the game was started, and the time elapsed since last update. #endregion Fields #region Constructors /// <summary> /// Creates a doPacket. Only one of these is needed per update. /// </summary> /// <param name="s">The master game state</param> /// <param name="t">The GameTime, which includes the time since the game was started, and the time elapsed since last update.</param> /// <param name="c">The controller</param> public doPacket(GameState s, GameTime t, Controller c) { state = s; controller = c; time = t; }
/// <summary> /// This will set the controller after the start button /// </summary> /// <param name="c"></param> public void setController(Controller c) { controller = c; doPack.controller = c; }