public Game() : base(Consts.ScreenWidth * Consts.ScreenScale, Consts.ScreenHeight * Consts.ScreenScale, GraphicsMode.Default, "Flappy bird") { ticks = 0; spriteBatch = new SpriteBatch(ClientSize); core = new Core(spriteBatch, new Size(Consts.ScreenWidth * Consts.ScreenScale, Consts.ScreenHeight * Consts.ScreenScale)); }
public Renderer(Core core, SpriteBatch spriteBatch, int screenWidth, int screenHeight) { this.core = core; this.spriteBatch = spriteBatch; ScreenWidth = screenWidth; ScreenHeight = screenHeight; surface = SpriteBatch.CreateSurface("Content\\SpriteSheet.png"); }
public Core(SpriteBatch spriteBatch, Size viewport) { random = new Random(); viewport.Height /= Consts.ScreenScale; viewport.Width /= Consts.ScreenScale; this.spriteBatch = spriteBatch; renderer = new Renderer(this, spriteBatch, viewport.Width, viewport.Height); stateManager = new StateManager(); stateManager.SetState(new MenuState(this));; ticks = 0; }