Exemple #1
0
        public GameState(GraphicsDeviceManager g, ContentManager c, Viewport v)
            : base(g, c, v)
        {
            me = this;
            viewport = v;

            ButtonSize = new Vector2(viewport.Width * 0.34f, viewport.Width * 0.17f);
            btnPlay = content.Load<Texture2D>("btnPlay");
            playLocation = new Vector2((viewport.Width - ButtonSize.X) / 2, viewport.Height * 0.6f);

            score = new Score(v, c);
            score.display = true;

            player = new Player(v);
            player.LoadContent(c);

            obstacles = new Obstacles(viewport);
            obstacles.LoadContent(content);

            spriteFont = content.Load<SpriteFont>("ScoreFont");
            READEsize = spriteFont.MeasureString("Get Ready");
            Menusize = spriteFont.MeasureString("Sway Copter");
            GameOverSize = spriteFont.MeasureString("Game Over");

            GameOverLocation = new Vector2((viewport.Width - spriteFont.MeasureString("Game Over").X) / 2, -GameOverSize.Y);

            Scoreboard = content.Load<Texture2D>("Dashboard");
            ScoreboardSize = new Vector2(viewport.Width * .9f, viewport.Width * 0.545625f);
            ScoreboardLocation = new Vector2((viewport.Width - ScoreboardSize.X) / 2, viewport.Height);

            buttonSound = c.Load<SoundEffect>("swing");
        }
Exemple #2
0
        public GameState(GraphicsDeviceManager g, ContentManager c, Viewport v)
            : base(g, c, v)
        {
            me = this;
            viewport = v;

            ButtonSize = new Vector2(viewport.Width * 0.34f, viewport.Width * 0.17f);
            btnPlay = content.Load<Texture2D>("btnPlay");
            btnRate = content.Load<Texture2D>("btnRate");
            playLocation = new Vector2((viewport.Width / 2) - ButtonSize.X - (viewport.Height / 40), viewport.Height * 0.6f);
            rateLocation = new Vector2((viewport.Width / 2) + (viewport.Height / 40), viewport.Height * 0.6f);

            score = new Score(v, c);
            score.display = true;

            player = new Player(v);
            player.LoadContent(c);

            obstacles = new Obstacles(viewport);
            obstacles.LoadContent(content);

            spriteFont = content.Load<SpriteFont>("ScoreFont");
            READEsize = spriteFont.MeasureString("Get Ready");
            Menusize = spriteFont.MeasureString("Twerkopter");
            GameOverSize = spriteFont.MeasureString("Game Over");

            GameOverLocation = new Vector2((viewport.Width - spriteFont.MeasureString("Game Over").X) / 2, -GameOverSize.Y);

            Scoreboard = content.Load<Texture2D>("Dashboard");
            ScoreboardSize = new Vector2(viewport.Width * .9f, viewport.Width * 0.545625f);
            ScoreboardLocation = new Vector2((viewport.Width - ScoreboardSize.X) / 2, viewport.Height);

            MedalBronze = content.Load<Texture2D>("Bronze-Medal");
            MedalSilver = content.Load<Texture2D>("Silver-Medal");
            MedalGold = content.Load<Texture2D>("Gold-Medal");

            MedalSize = new Vector2(70 * ScoreboardSize.Y / 194);
            MedalLocation = new Vector2(27 * (ScoreboardSize.X / 320), 76 * (ScoreboardSize.Y / 194));

            buttonSound = c.Load<SoundEffect>("swing");
        }
Exemple #3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            var content = this.Content;

            btnPlay = content.Load<Texture2D>("btnPlay");
            btnRate = content.Load<Texture2D>("btnRate");

            player.LoadContent(content);
            obstacles.LoadContent(content);

            score = new Score(viewport, content);
            score.display = true;

            spriteFont = content.Load<SpriteFont>("ScoreFont");
            Scoreboard = content.Load<Texture2D>("Dashboard");

            READEsize = spriteFont.MeasureString("Get Ready");
            Menusize = spriteFont.MeasureString("Twerkopter");

            GameOverSize = spriteFont.MeasureString("Game Over");
            GameOverLocation = new Vector2(viewport.Width / 2, 20);

            MedalBronze = content.Load<Texture2D>("Bronze-Medal");
            MedalSilver = content.Load<Texture2D>("Silver-Medal");
            MedalGold = content.Load<Texture2D>("Gold-Medal");

            buttonSound = content.Load<SoundEffect>("swing");
        }