Beispiel #1
0
        public void Init()
        {
            speed = 5;//1000 / speed;
            player = new Player(game, this, new Rectangle(512, 0, 32, 32));
            game.Components.Add(player);
            Block floor = new Block(game, this, new Rectangle(0, 736, 1024, 32), Color.SpringGreen, 0, 0);//740
            blocks.Add(floor);

            game.Components.Add(floor);

            CheckNextBlockSpawn();

            this.highScore = new HighScoresWindow(game);
            game.Components.Add(this.highScore);

            this.scoreText = new Text(game, "Score: " + this.points, new Vector2(0,0), Color.Blue);
            game.Components.Add(this.scoreText);

            music = this.game.Content.Load<SoundEffect>("home_at_last");

            musicInstance = music.CreateInstance();
            musicInstance.IsLooped = true;
            musicInstance.Play();

            points = 0;
        }
Beispiel #2
0
        public void Init()
        {
            this.player = new Player(game, this, new Rectangle(512, -32, 32, 32));
            game.Components.Add(player);

            Block floor = new Block(game, this, new Rectangle(-32, 32, 1024 + 64, 32), Color.RoyalBlue, this.speed);
            blocks.Add(floor);
            game.Components.Add(floor);

            this.scoreText = new Text(game, "Score: " + this.points, new Vector2(0,0), Color.Blue);
            game.Components.Add(this.scoreText);

            this.highScore = new HighScoresWindow(game);
            game.Components.Add(this.highScore);

            music = this.game.Content.Load<SoundEffect>("bamboo");

            musicInstance = music.CreateInstance();
            musicInstance.IsLooped = true;
            musicInstance.Play();
        }
Beispiel #3
0
        public void Init()
        {
            this.player = new Player(game, this, new Rectangle(1024 - 40, 768 - 64, 32, 32));
            game.Components.Add(player);

            Block floor = new Block(game, this, new Rectangle(1024 - 48, 768 - 32, 48, 1024), Color.Cyan, this.speed, 0);

            blocks.Add(floor);
            game.Components.Add(floor);

            this.scoreText = new Text(game, "Score: " + this.points, new Vector2(0,0), Color.Blue);
            game.Components.Add(this.scoreText);

            this.highScore = new HighScoresWindow(game);
            game.Components.Add(this.highScore);

            music = this.game.Content.Load<SoundEffect>("home_at_last");

            musicInstance = music.CreateInstance();
            musicInstance.IsLooped = true;
            musicInstance.Play();
        }