示例#1
0
        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));
        }
示例#2
0
        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");
        }
示例#3
0
        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;
        }