protected override void Update(GameTime gameTime) { gameState = AsteroidGame.updateState( Keyboard.GetState(), Mouse.GetState(), (float)gameTime.ElapsedGameTime.TotalSeconds, gameState); base.Update(gameTime); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); foreach (var drawable in AsteroidGame.drawState(gameState)) { spriteBatch.Draw(Content.Load <Texture2D>(drawable.Image), drawable.Position, Color.White); } spriteBatch.End(); base.Draw(gameTime); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); gameState = AsteroidGame.initialState(); base.LoadContent(); }
protected PlayerIndex playerIndexInControl; // The player index in control... usually player 1 #endregion Fields #region Constructors public BaseGameState(Game game, GameStateManager manager) : base(game, manager) { GameRef = (AsteroidGame)game; playerIndexInControl = PlayerIndex.One; }