示例#1
0
 protected override void Update(GameTime gameTime)
 {
     gameState = AsteroidGame.updateState(
         Keyboard.GetState(), Mouse.GetState(),
         (float)gameTime.ElapsedGameTime.TotalSeconds,
         gameState);
     base.Update(gameTime);
 }
示例#2
0
        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);
        }
示例#3
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     gameState   = AsteroidGame.initialState();
     base.LoadContent();
 }
示例#4
0
        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;
        }