public SettingsMenu(Weather weather, ScreenManager screenManager)
 {
     this.weather = weather;
     this.screenManager = screenManager;
     btnBack = new Button("Buttons", new Vector2(600, 400), new Rectangle(0, 120 * 6, 250, 120), false, false);
     btnChangeWeather = new Button("Buttons", new Vector2(200, 200), new Rectangle(250, 120 * 1, 250, 120), false, false);
     btnChangePlayer = new Button("Buttons", new Vector2(200, 400), new Rectangle(250, 120 * 0, 250, 120), false, false);
     LoadContent();
 }
 public WeatherMenu(ScreenManager screenManager, Weather weather)
 {
     this.screenManager = screenManager;
     this.weather = weather;
     btnBack = new Button("Buttons", new Vector2(600, 400), new Rectangle(0, 120 * 6, 250, 120), false, false);
     btnSunny = new Button("Buttons", new Vector2(200, 100), new Rectangle(250, 120 * 2, 250, 120), false, false);
     btnCloudy = new Button("Buttons", new Vector2(500, 100), new Rectangle(250, 120 * 3, 250, 120), false, false);
     btnRainy = new Button("Buttons", new Vector2(200, 300), new Rectangle(250, 120 * 4, 250, 120), false, false);
 }
        public void Update(GameTime gameTime, ScreenManager screenManager)
        {
            this.screenManager = screenManager;
            Input.Update();
            btnBack.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
            btnChangeWeather.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
            btnChangePlayer.Update((float)gameTime.ElapsedGameTime.TotalSeconds);

            Controls();
        }
Exemple #4
0
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public void Update(GameTime gameTime, ScreenManager screenManager)
        {
            this.screenManager = screenManager;
            Input.Update();
            btnBack.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
            btnResume.Update((float)gameTime.ElapsedGameTime.TotalSeconds);

            Controls();

            base.Update(gameTime);
        }
Exemple #5
0
 public DeadScreen(ScreenManager screenManager)
 {
     this.screenManager = screenManager;
     btnSendScore = new Button("Buttons", new Vector2(200, 400), new Rectangle(0, 120 * 12, 250, 120), false, false);
     btnRestart = new Button("Buttons", new Vector2(600, 400), new Rectangle(0, 120 * 10, 250, 120), false, false);
     btnChangePlayer = new Button("Buttons", new Vector2(200, 280), new Rectangle(250, 120 * 0, 250, 120), false, false);
     btnExit = new Button("Buttons", new Vector2(600, 280), new Rectangle(0, 120 * 7, 250, 120), false, false);
     this.fontColor = Color.White;
     transparentBackground = new Sprite("pixel");
     transparentBackground.Source = new Rectangle(0, 0, Stuff.Resolution.X, Stuff.Resolution.Y);
     transparentBackground.iColor.SetColor(0, 0, 0, 100);
     transparentBackground.Origin = Vector2.Zero;
     LoadContent();
 }
Exemple #6
0
        public void Update(GameTime gameTime, ScreenManager screenManager)
        {
            DrawRect = new Rectangle((int)player.Position.X - graphics.PreferredBackBufferWidth - 250, (int)player.Position.Y - (graphics.PreferredBackBufferHeight) - 250, (graphics.PreferredBackBufferWidth *2) + 500, (graphics.PreferredBackBufferHeight * 2) + 500);
            WorldGen.Update(DrawRect, player.Position, ref player.coin);
            elaps = (float)gameTime.ElapsedGameTime.TotalSeconds;
            totaltPlayTime += elaps;
            Input.Update();
            onScreenMessages.Update(elaps);
            int c = characters.Count;
            for (int i = 0; i < c; i++)
            {
                characters[i].Update(elaps);
            }

            if (player.Position.X > 2000)
                bird.Update(player, elaps);

            player.Update(elaps, yaccel, screenManager);

            //playerOnGround = player.IsOnGround;
        }
Exemple #7
0
        public void Update(float elaps, float yaccel, ScreenManager screenManager)
        {
            ph.Update(elaps);
            if (!adjustPlayer)
            {
                position = WorldGen.StartPos;
                adjustPlayer = true;
            }
            collisionRect = new Rectangle(
                (int)position.X - (int)(sprite.Origin.X * sprite.Scale),
                (int)position.Y - (int)(sprite.Origin.Y * sprite.Scale),
                (int)(sprite.Texture.Width * sprite.Scale),
                (int)(sprite.Texture.Height * sprite.Scale));

            this.screenManager = screenManager;
            btnRight.Update(elaps);
            btnLeft.Update(elaps);
            btnJump.Update(elaps);
            btnPause.Update(elaps);
            btnDebug.Update(elaps);

            Point matrixPos = WorldGen.GetMatrixPos(new Vector2(position.X, position.Y));

            if (life == 0)
            {
                screenManager.playerDead();
            }
            else
            {
                Controls(matrixPos, elaps);
            }

            ay = yaccel;

            base.Update(elaps);

            //AdjustSpriteY();

            Camera2d.Position = position + (Stuff.AngleToVector(sprite.Rotation + (float)Math.PI) * 30);
        }
Exemple #8
0
 public void Update(GameTime gameTime, ScreenManager screenManager)
 {
     float elaps = (float)gameTime.ElapsedGameTime.TotalSeconds;
     this.screenManager = screenManager;
     Input.Update();
     int c = buttons.Count;
     for (int i = 0; i < c; i++)
     {
         buttons[i].Update(elaps);
     }
     Controls();
     menuEgg.Update(elaps);
 }
Exemple #9
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     screenManager = new ScreenManager(Content, graphics);
 }