Example #1
0
        /////////////////////////////////////
        ///MENU //////REINICIAR//////////////
        /////////////////////////////////////

        private void reiniciarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tiempo       = 0;
            Time.Text    = "Tiempo :  " + tiempo;
            BarLv3.Value = 0;
            ContadoresLv3.Stop();
            MensajeInicio.Visible = true;
            CriaturaBox.Visible   = false;
        }
Example #2
0
        /////////////////////////////////////
        ///CONTADORES = TIEMPO //////////////
        /////////////////////////////////////

        private void Contadores_Tick(object sender, EventArgs e)
        {
            tiempo--;
            Time.Text = "Tiempo : " + tiempo;
            if (tiempo == 0)
            {
                ContadoresLv3.Stop();
                Defeat frm = new Defeat();
                frm.Show();
            }
        }
Example #3
0
        private void Nivel_3_KeyDown(object sender, KeyEventArgs e)
        {
            /////////////////////////////////////
            ////MOVIMIENTO DEL MonstruoBox///////
            /////////////////////////////////////
            if ((e.KeyData == Keys.A) && (MonstruoBox.Location.X >= 0))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X - 20, MonstruoBox.Location.Y);
            }

            if ((e.KeyData == Keys.D) && (MonstruoBox.Location.X <= 800))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X + 20, MonstruoBox.Location.Y);
            }
            if ((e.KeyData == Keys.W) && (MonstruoBox.Location.Y >= 30))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X, MonstruoBox.Location.Y - 20);
            }

            if ((e.KeyData == Keys.S) && (MonstruoBox.Location.Y <= 500))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X, MonstruoBox.Location.Y + 20);
            }
            ///////////////////////////////////
            /////MOVIMIENTO DE LA CRIATURA/////
            ///////////////////////////////////

            if (CriaturaBox.Bounds.IntersectsWith(MonstruoBox.Bounds))
            {
                Move_Criatura();
                lv1         = lv1 + 10;
                Comida.Text = "Ciraturas Comidas : " + lv1;
                BarLv3.Increment(10);
            }
            if (lv1 == 10)
            {
                VictoriaLv3 frm = new VictoriaLv3();
                frm.Show();
                ContadoresLv3.Stop();
                this.Close();
            }
            ///////////////////////////////////
            /////AVISOS EN LA PANTALLA/////////
            ///////////////////////////////////
            if (e.KeyData == Keys.Space)
            {
                CriaturaBox.Visible = true;
                ContadoresLv3.Start();
                MensajeInicio.Visible = false;
            }
        }
Example #4
0
 /////////////////////////////////////
 ///MENU //////PAUSAR////////////////
 /////////////////////////////////////
 private void pausarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Cursor.Show();
     if (pausarToolStripMenuItem.Text == "Pausar")
     {
         pausarToolStripMenuItem.Text = "Reanudar";
         ContadoresLv3.Stop();
         CriaturaBox.Visible = false;
     }
     else
     {
         if (pausarToolStripMenuItem.Text == "Reanudar")
         {
             pausarToolStripMenuItem.Text = "Pausar";
             ContadoresLv3.Start();
             CriaturaBox.Visible = true;
         }
     }
 }
Example #5
0
 /////////////////////////////////////
 ///MENU //////COMENZAR //////////////
 /////////////////////////////////////
 private void comenzarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CriaturaBox.Visible = true;
     ContadoresLv3.Start();
     MensajeInicio.Visible = false;
 }
Example #6
0
        private void Multiplayer_KeyDown(object sender, KeyEventArgs e)
        {
            /////////////////////////////////////
            ////MOVIMIENTO DEL MonstruoBox///////
            /////////////////////////////////////
            if ((e.KeyData == Keys.A) && (MonstruoBox.Location.X >= 0))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X - 20, MonstruoBox.Location.Y);
            }

            if ((e.KeyData == Keys.D) && (MonstruoBox.Location.X <= 800))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X + 20, MonstruoBox.Location.Y);
            }
            if ((e.KeyData == Keys.W) && (MonstruoBox.Location.Y >= 30))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X, MonstruoBox.Location.Y - 20);
            }

            if ((e.KeyData == Keys.S) && (MonstruoBox.Location.Y <= 500))
            {
                MonstruoBox.Location = new Point(MonstruoBox.Location.X, MonstruoBox.Location.Y + 20);
            }
            ///////////////////////////////////
            /////COLICIONES DE LA CRIATURA/////
            ///////////////////////////////////

            if (CriaturaBox.Bounds.IntersectsWith(MonstruoBox.Bounds))
            {
                Defeat frm = new Defeat();
                frm.Show();
            }

            /////////////////////////////////////
            ////MOVIMIENTO DEL CriaturaBox///////
            /////////////////////////////////////
            if ((e.KeyData == Keys.Left) && (CriaturaBox.Location.X >= 0))
            {
                CriaturaBox.Location = new Point(CriaturaBox.Location.X - 20, CriaturaBox.Location.Y);
            }

            if ((e.KeyData == Keys.Right) && (CriaturaBox.Location.X <= 800))
            {
                CriaturaBox.Location = new Point(CriaturaBox.Location.X + 20, CriaturaBox.Location.Y);
            }
            if ((e.KeyData == Keys.Up) && (CriaturaBox.Location.Y >= 30))
            {
                CriaturaBox.Location = new Point(CriaturaBox.Location.X, CriaturaBox.Location.Y - 20);
            }

            if ((e.KeyData == Keys.Down) && (CriaturaBox.Location.Y <= 500))
            {
                CriaturaBox.Location = new Point(CriaturaBox.Location.X, CriaturaBox.Location.Y + 20);
            }

            ///////////////////////////////////
            /////AVISOS EN LA PANTALLA/////////
            ///////////////////////////////////
            if (e.KeyData == Keys.Space)
            {
                CriaturaBox.Visible = true;
                ContadoresLv3.Start();
                MensajeInicio.Visible = false;
            }
        }