예제 #1
0
파일: Game.cs 프로젝트: kamilkk/FlappyBird
        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
파일: Core.cs 프로젝트: kamilkk/FlappyBird
        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;
        }