コード例 #1
0
ファイル: MenuState.cs プロジェクト: kamilkk/FlappyBird
        public MenuState(Core core)
            : base(core)
        {
            skyLineActor = new SkyLineActor(core);
              groundActor = new GroundActor(core);
              birdActor = new FreeBirdActor(core, Consts.ScreenWidth / 2 - 10, Consts.ScreenHeight / 2 - 25);

              titleSprite = new Sprite(new Rectangle(146, 173, 96, 22));
        }
コード例 #2
0
ファイル: ActionState.cs プロジェクト: kamilkk/FlappyBird
        public ActionState(Core core, BirdActor birdActor, GroundActor groundActor, ScoreActor scoreActor)
            : base(core)
        {
            skyLineActor = new SkyLineActor(core);
              this.groundActor = new GroundActor(core, groundActor.x);
              this.birdActor = new PlayerBirdActor(core, birdActor.x, birdActor.y);
              pipeActors = new List<PipeActor>();
              this.scoreActor = scoreActor;

              this.birdActor.OnKeyPress(Key.Space);

              nextPipeTick = 100;
              ticks = 0;
        }
コード例 #3
0
ファイル: GameOverState.cs プロジェクト: kamilkk/FlappyBird
        public GameOverState(Core core, BirdActor birdActor, GroundActor groundActor, List<PipeActor> pipeActors, ScoreActor scoreActor)
            : base(core)
        {
            gameOverSprite = new Sprite(new Rectangle(146, 199, 94, 19));

              skyLineActor = new SkyLineActor(core);
              this.groundActor = groundActor;
              this.pipeActors = pipeActors;
              this.birdActor = birdActor;
              this.scoreActor = scoreActor;

              if (scoreActor.score > Consts.MaxScore)
              {
            Consts.MaxScore = scoreActor.score;
              }

              statisticsActor = new StatisticsActor(core, scoreActor.score);

              stressTtl = 11;
        }