public override void Draw(Renderer2D renderer, GameTime time) { renderer.Begin(cam.Transform); TimeWatcher.Start("Map.Draw"); w.map.Draw(renderer, cam.Transform); TimeWatcher.End(); renderer.End(); if (debug) { renderer.Begin(cam.Transform); DebugRenderer.DrawWorld(renderer, time); renderer.End(); renderer.Begin(); DebugRenderer.DrawScreen(renderer, time); renderer.End(); } }
public override void Update(UpdateContainer container) { DebugRenderer.Update(container); if (container.Keyboard.IsKeyPressed(Keys.U)) { followedNPC = (followedNPC + 1) % w.npcs.Count; cam.Follow = w.npcs[followedNPC]; } if (container.Keyboard.IsKeyPressed(Keys.N)) { debug = !debug; } TimeWatcher.Start("World.Update"); w.Update(container.Time); TimeWatcher.End(); TimeWatcher.Start("Camera.Update"); cam.Update(container.Time); TimeWatcher.End(); }