コード例 #1
0
ファイル: Bird.cs プロジェクト: splitandthechro/nginz
 public Bird(Game game, TubeGenerator generator)
 {
     this.game = game;
     this.generator = generator;
     var sheetTex = game.Content.Load<Texture2D> ("flappymascot_char.png", TextureConfiguration.Nearest);
     sheet = new SpriteSheet2D (sheetTex, 4, 1);
     animator = new Animator (sheet, 4);
     animator.DurationInMilliseconds = 500;
     animator.Position.X = game.Resolution.Width * 0.25f;
     ypos = (game.Resolution.Height / 2) + (sheet [0].Height / 2);
 }
コード例 #2
0
ファイル: Bird.cs プロジェクト: parhelia512/nginz
        public Bird(Game game, TubeGenerator generator)
        {
            this.game      = game;
            this.generator = generator;
            var sheetTex = game.Content.Load <Texture2D> ("flappymascot_char.png", TextureConfiguration.Nearest);

            sheet    = new SpriteSheet2D(sheetTex, 4, 1);
            animator = new Animator(sheet, 4);
            animator.DurationInMilliseconds = 500;
            animator.Position.X             = game.Resolution.Width * 0.25f;
            ypos = (game.Resolution.Height / 2) + (sheet [0].Height / 2);
        }
コード例 #3
0
ファイル: GameScene.cs プロジェクト: splitandthechro/nginz
 public GameScene()
     : base("maingame")
 {
     game = UIController.Instance.Game;
     generator = new TubeGenerator (game);
     bird = new Bird (game, generator);
     lblScore = new Label (150, 20, "Roboto Regular") {
         X = 25,
         Y = game.Resolution.Height - 45,
         FontSize = 18f,
         Text = "Score: 0"
     };
     backgroundLeft = 0f;
     blueTint = 0f;
     texMap = game.Content.Load<Texture2D> ("flappymascot_map_new.png");
     Controls.Add (lblScore);
 }
コード例 #4
0
 public GameScene() : base("maingame")
 {
     game      = UIController.Instance.Game;
     generator = new TubeGenerator(game);
     bird      = new Bird(game, generator);
     lblScore  = new Label(150, 20, "Roboto Regular")
     {
         X        = 25,
         Y        = game.Resolution.Height - 45,
         FontSize = 18f,
         Text     = "Score: 0"
     };
     backgroundLeft = 0f;
     blueTint       = 0f;
     texMap         = game.Content.Load <Texture2D> ("flappymascot_map_new.png");
     Controls.Add(lblScore);
 }