Exemple #1
0
 private void Pierdes2Lv3_Tick(object sender, EventArgs e)
 {
     //////////////////////////////////////
     ///COLISION ENTRE MONSTRUO Y LAGOS////
     //////////////////////////////////////
     Monstruo = new Rectangle(MonstruoBox.Location.X, MonstruoBox.Location.Y, MonstruoBox.Width, MonstruoBox.Height);
     for (int j = 0; j < Bloques.GetLength(1); j++)
     {
         for (int i = 0; i < Bloques.GetLength(0); i++)
         {
             if (Bloques[i, j].IntersectsWith(Monstruo))
             {
                 MonstruoBox.Location = new Point(Mov.Next(0), (Mov.Next(0)));
                 Defeat frm = new Defeat();
                 frm.Show();
             }
         }
     }
     ///////////////////////////////////////
     //// COLISION ENTRE CENTINELA Y LAGOS//
     ///////////////////////////////////////
     Poder = new Rectangle(Centinela.Location.X, Centinela.Location.Y, Centinela.Width, Centinela.Height);
     for (int j = 0; j < Bloques.GetLength(1); j++)
     {
         for (int i = 0; i < Bloques.GetLength(0); i++)
         {
             if (Bloques[i, j].IntersectsWith(Poder))
             {
                 Centinela.Location = new Point(Mov.Next(650), (Mov.Next(370)));
             }
         }
     }
 }
Exemple #2
0
        private void Pierdes_Tick(object sender, EventArgs e)
        {
            //////////////////////////////////////
            ///COLISION ENTRE MONSTRUO Y LAGOS////
            //////////////////////////////////////
            Monstruo = new Rectangle(MonstruoBox.Location.X, MonstruoBox.Location.Y, MonstruoBox.Width, MonstruoBox.Height);
            for (int j = 0; j < Bloques.GetLength(1); j++)
            {
                for (int i = 0; i < Bloques.GetLength(0); i++)
                {
                    if (Bloques[i, j].IntersectsWith(Monstruo))
                    {
                        MonstruoBox.Location = new Point(Mov.Next(0), (Mov.Next(0)));
                        Defeat frm = new Defeat();
                        this.Close();
                        frm.Show();
                    }
                }
            }

            //////////////////////////////////////
            ///COLISION ENTRE CRIATURA Y LAGOS////
            //////////////////////////////////////
            Criatura = new Rectangle(CriaturaBox.Location.X, CriaturaBox.Location.Y, CriaturaBox.Width, CriaturaBox.Height);
            for (int j = 0; j < Bloques.GetLength(1); j++)
            {
                for (int i = 0; i < Bloques.GetLength(0); i++)
                {
                    if (Bloques[i, j].IntersectsWith(Criatura))
                    {
                        Move_Criatura();
                    }
                }
            }
        }
Exemple #3
0
        private void Pierdes_Tick(object sender, EventArgs e)
        {
            //////////////////////////////////////
            ///COLISION ENTRE MONSTRUO Y LAGOS////
            //////////////////////////////////////
            Monstruo = new Rectangle(MonstruoBox.Location.X, MonstruoBox.Location.Y, MonstruoBox.Width, MonstruoBox.Height);
            for (int j = 0; j < Bloques.GetLength(1); j++)
            {
                for (int i = 0; i < Bloques.GetLength(0); i++)
                {
                    if (Bloques[i, j].IntersectsWith(Monstruo))
                    {
                        MonstruoBox.Location = new Point(Mov.Next(0), (Mov.Next(0)));
                        Defeat frm = new Defeat();
                        frm.Show();
                        MessageBox.Show("El monstruo ha caido en un lago, la criatura gana");
                        this.Close();
                    }
                }
            }
            //////////////////////////////////////
            ///COLISION ENTRE CRIATURA Y LAGOS////
            //////////////////////////////////////
            Criatura = new Rectangle(CriaturaBox.Location.X, CriaturaBox.Location.Y, CriaturaBox.Width, CriaturaBox.Height);
            for (int j = 0; j < Bloques.GetLength(1); j++)
            {
                for (int i = 0; i < Bloques.GetLength(0); i++)
                {
                    if (Bloques[i, j].IntersectsWith(Criatura))
                    {
                        CriaturaBox.Location = new Point(Mov.Next(0), (Mov.Next(0)));
                        Defeat frm = new Defeat();
                        frm.Show();
                        MessageBox.Show("La Cratura ha caido en un lago. El monstruo gana");
                        this.Close();
                    }
                }
            }

            //////////////////////////////////////
            //COLISION ENTRE CRIATURA Y MONSTRUO//
            //////////////////////////////////////
            for (int j = 0; j < Bloques.GetLength(1); j++)
            {
                for (int i = 0; i < Bloques.GetLength(0); i++)
                {
                    if (Criatura.IntersectsWith(Monstruo))
                    {
                        CriaturaBox.Location = new Point(1049, 268);
                        MessageBox.Show("El monstruo se ha comido a la Criatura");
                        VictoryMultijugador frm = new VictoryMultijugador();
                        frm.Show();
                        this.Close();
                    }
                }
            }
        }
Exemple #4
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();
            }
        }
Exemple #5
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;
            }
        }