Beispiel #1
0
        protected override void Draw(GameTime gameTime) // calls after Update()
        {
            if (IsActive)
            {
                // FPS and update count debug
                if (_frameCount >= _targetFPS - 1)
                {
                    _frameCount = 0;
                }
                else
                {
                    _frameCount++;
                }

                _frameRate = Math.Round((1 / gameTime.ElapsedGameTime.TotalSeconds), 1);

                GraphicsDevice.Clear(Color.Black);
                SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, null, null, null, null, _view);

                SpriteBatch.DrawString(Debug.Assets.DebugFont, "                     DrawDebug:[F1]       Pause:[P]       Action:[Arrows][Z][X]      Rooms1&2:[F2][F3]", new Vector2(10, 10), Color.White);
                SpriteBatch.DrawString(Debug.Assets.DebugFont, "_frameCount:  " + _frameCount, new Vector2(10, 36), Color.White);
                SpriteBatch.DrawString(Debug.Assets.DebugFont, "_targetFPS:   " + _targetFPS, new Vector2(10, 48), Color.White);
                SpriteBatch.DrawString(Debug.Assets.DebugFont, "_frameRate:   " + _frameRate, new Vector2(10, 60), Color.White);

                CurrentRoom.Draw();
                SpriteBatch.End();

                base.Draw(gameTime);
            }
        }
Beispiel #2
0
 public void Draw(SpriteBatch spriteBatch)
 {
     Map.Draw(spriteBatch);
     if (CurrentRoom != null)
     {
         CurrentRoom.Draw(spriteBatch);
     }
 }
Beispiel #3
0
        public void DrawStep4(Camera2D camera, RenderStep step, GameTime gameTime)
        {
            CurrentRoom.Draw(camera);

            if (LevelEV.SHOW_ENEMY_RADII)
            {
                foreach (var enemyList in m_currentRoom.EnemyList)
                {
                    enemyList.DrawDetectionRadii(camera);
                }
            }

            m_projectileManager.Draw(camera);
        }