/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); _spriteBatch.Begin(); _stopwatch.Restart(); World.Draw(gameTime.ElapsedGameTime.TotalMilliseconds, _spriteBatch); _spriteBatch.DrawString(FontManager.Instance.GetFont(FontEnum.ARIAL_16), "Draw : " + _stopwatch.Elapsed.TotalMilliseconds.ToString("0.00") + " ms", new Vector2(10, 10), Color.Yellow); _spriteBatch.DrawString(FontManager.Instance.GetFont(FontEnum.ARIAL_16), "Update : " + _updateTime.ToString("0.00") + " ms", new Vector2(10, 30), Color.Yellow); //Affichage vie + score player var player = World.EntityManager.GetEntities().Where(x => ((TypeComponent)x.GetComponent(5)).Type == Data.Enums.EnumTypeEntity.PLAYER).FirstOrDefault(); if (player != null) { var scoreComponent = ((ScoreComponent)player.GetComponent(9)); _spriteBatch.DrawString(FontManager.Instance.GetFont(FontEnum.ARIAL_16), "Score : " + scoreComponent.Score, new Vector2(10, 50), Color.Yellow); } _spriteBatch.End(); base.Draw(gameTime); }
private void DrawFrame() { Console.Clear(); MyWorld.Draw(); CurrentPlayer.Draw(); }