예제 #1
0
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            // TODO: Add your update logic here
            bola.updatear();
            j1.update(new Vector2(1160, Mouse.GetState().Y), bola);
            j2.update(j2.posicion, bola);
            base.Update(gameTime);
        }
예제 #2
0
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            // TODO: Add your update logic here
            bola.updatear(ref puntosS, ref puntosC);
            j1.update(new Vector2(1160, 512 + (pos - 50) * -10), bola, true);
            j2.update(j2.posicion, bola, false);
            base.Update(gameTime);

            if (Keyboard.GetState().IsKeyDown(Keys.R))
            {
                puntosC = 0;
                puntosS = 0;
                bola.nuevaBola();
                MediaPlayer.Stop();
                MediaPlayer.Play(musica);
                estado     = "play";
                playcountS = 5;
            }
            if (playcountS >= 0)
            {
                playcountS--;
                if (playcountS == 0)
                {
                    estado = "---";
                }
            }

            if (i >= 100)
            {
                i = 1;
            }
        }