Ejemplo n.º 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;
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 4
0
        protected override void LoadContent()
        {
            //			Active = true;//For t esting.

            keyArray = new Keys[]
            {
                Keys.A, Keys.B, Keys.C, Keys.D, Keys.E, Keys.F, Keys.G, Keys.H, Keys.I, Keys.J, Keys.K, Keys.L, Keys.M,
                Keys.N, Keys.O, Keys.P, Keys.Q, Keys.R, Keys.S, Keys.T, Keys.U, Keys.V, Keys.W, Keys.X, Keys.Y, Keys.Z
            };

            LoadHighScores();
            background1 = CreateTexture(400, 600, game.graphics);
            background2 = CreateTexture(370, 570, game.graphics);
            nameBack1 = CreateTexture(400, 200, game.graphics);
            namePos1 = new Vector2(312, 284);
            nameBack2 = CreateTexture(370, 170, game.graphics);
            namePos2 = new Vector2(327, 299);
            highscoreTile = CreateTexture(370, 52, game.graphics);
            enterNameText = new Text(game, "ENTER YOUR NAME", new Vector2 (415, 310), Color.White);
            enterNameText.OtherLoadContent("HighJakarta_22");
            nameText = new Text(game, "Type Your Name", new Vector2 (415, 380), Color.White);
            nameText.OtherLoadContent("HighJakarta_22");
            gameText1 = new Text(game, "", new Vector2(), Color.White);
            gameText1.OtherLoadContent("HighJakarta_22");
            gameText2 = new Text(game, "", new Vector2 (), Color.White);
            gameText2.OtherLoadContent("HighJakarta_22");
        }
Ejemplo n.º 5
0
            public Button(Jump game, ILevel level, Rectangle blockRect, Color color, string txt, int lvl)
                : base(game, level, blockRect, color, 0)
            {
                this.text = new Text(game, txt, new Vector2(blockRect.X, blockRect.Y),
                                     Color.Black);

                this.lvl = lvl;
            }