public void Initialize(bool editor, ContentManager content) { this.spriteBatch = new SpriteBatch(GameLoop.gameInstance.GraphicsDevice); _flipFlop = new RenderTargetFlipFlop(ref spriteBatch); _flipFlop.Initialise(); _Gravitation = new Vector2(0.0f, 9.8f); Physics = new World(_Gravitation); debugView = new DebugViewXNA(Level.Physics); Camera.initialize(GameSettings.Default.resolutionWidth, GameSettings.Default.resolutionHeight); Camera.Position = new Vector2(GameSettings.Default.resolutionWidth / 2, GameSettings.Default.resolutionHeight / 2); Camera.Scale = GameSettings.Default.gameCamScale; if (editor) { ParticleManager.initializeInEditor(content); } else { ParticleManager.initialize(); } this.GraphicsEnabled = true; this.DebugViewEnabled = false; this._contentPath = Path.Combine(Directory.GetCurrentDirectory(), "Content"); foreach (Layer l in layerList) { l.initializeLayer(); } }
public void InitializeInEditor(GraphicsDevice graphics, SpriteBatch spriteBatch, float viewportWidth, float viewportHeight) { this.spriteBatch = spriteBatch; _flipFlop = new RenderTargetFlipFlop(ref spriteBatch); _flipFlop.InitialiseInEditor(graphics, viewportWidth, viewportHeight); _Gravitation = new Vector2(0.0f, 9.8f); Physics = new World(_Gravitation); debugView = new DebugViewXNA(Level.Physics); Camera.initialize(viewportWidth, viewportHeight); Camera.Position = new Vector2(viewportWidth / 2, viewportHeight / 2); this._contentPath = Path.Combine(Directory.GetCurrentDirectory(), "Content"); foreach (Layer l in layerList) { l.initializeLayer(); } }