Update() private method

private Update ( ) : void
return void
Exemplo n.º 1
0
        protected override void Update(Time delta)
        {
            Buttons.Update();
            if (Buttons["force_exit"].Held)
            {
                RenderWindow.Close();
            }

            Screens.Update(delta.AsSeconds());

            background.Position = RenderTarget.GetView().Center
                                  - new Vector2f(RenderTarget.Size.X, RenderTarget.Size.Y) / 2f;
            background.Color = Palette;
        }
Exemplo n.º 2
0
        protected override void Update(GameTime gameTime)
        {
            //Changes Time
            timeSinceLastUpdate += (int)gameTime.ElapsedGameTime.TotalMilliseconds;
            switch (timeSinceLastUpdate >= millisecondsPerFrame)
            {
            case true:
                timeSinceLastUpdate = 0;
                upgrades.Update(gameTime, buttons);
                break;

            default:
                break;
            }

            // LOOPS
            switch (souls.souls < 0)
            {
            case true:
                souls.souls = 0;
                break;

            default:
                break;
            }

            switch (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
            case true:
                Exit();
                break;

            default:
                break;
            }

            switch (souls.souls >= 10000000000 && buttons.completetick == 0)
            {
            case true:
                buttons.completetick = 1;
                break;

            default:
                break;
            }

            switch (buttons.button10Pressedtick == 1)
            {
            case true:
                endstate = 1;
                break;

            default:
                break;
            }

            //Mouse position state
            MouseY = Mouse.GetState().Y;
            MouseX = Mouse.GetState().X;

            // Mouse clicking
            MouseState newState = Mouse.GetState();

            switch (newState.LeftButton == ButtonState.Pressed)
            {
            case true:
                MouseDest.X = MouseX;
                MouseDest.Y = MouseY;
                break;

            default:
                break;
            }

            buttons.Update(gameTime, news, upgrades);

            news.Update(gameTime);

            base.Update(gameTime);
        }