Пример #1
0
        //Generador de objetos de tipo Soul;
        public void objectSoulGenerate()
        {
            //Random del usuario.
            player.SetCoordX(xGenerateCoordinate());
            player.SetCoordY(yGenerateCoordinate());
            ptbPlayer.Location = new Point(player.GetCoordX(), player.GetCoordY());

            //Alma número uno.
            soulOne.SetCoordX(xGenerateCoordinate());
            soulOne.SetCoordY(yGenerateCoordinate());
            ptbSoulOne.Location = new Point(soulOne.GetcoordX(), soulOne.GetCoordY());

            //Alma número dos.
            soulTwo.SetCoordX(xGenerateCoordinate());
            soulTwo.SetCoordY(yGenerateCoordinate());
            pbtSoulTwo.Location = new Point(soulTwo.GetcoordX(), soulTwo.GetCoordY());

            //Alma número tres.
            soulThree.SetCoordX(xGenerateCoordinate());
            soulThree.SetCoordY(yGenerateCoordinate());
            pbtSoulThree.Location = new Point(soulThree.GetcoordX(), soulThree.GetCoordY());

            //Alma número cuatro.
            soulFour.SetCoordX(xGenerateCoordinate());
            soulFour.SetCoordY(yGenerateCoordinate());
            pbtSoulFour.Location = new Point(soulFour.GetcoordX(), soulFour.GetCoordY());

            //Alma número cinco.
            soulFive.SetCoordX(xGenerateCoordinate());
            soulFive.SetCoordY(yGenerateCoordinate());
            pbtSoulFive.Location = new Point(soulFive.GetcoordX(), soulFive.GetCoordY());

            //Alma número seis.
            soulSix.SetCoordX(xGenerateCoordinate());
            soulSix.SetCoordY(yGenerateCoordinate());
            pbtSoulSix.Location = new Point(soulSix.GetcoordX(), soulSix.GetCoordY());

            //Denomino número cuatro.
            badFour.SetCoordX(xGenerateCoordinate());
            badFour.SetCoordY(yGenerateCoordinate());
            ptbBadFour.Location = new Point(badFour.GetcoordX(), badFour.GetCoordY());

            //Portal
            portal.SetCoordX(xGenerateCoordinate());
            portal.SetCoordY(yGenerateCoordinate());
            ptbPortal.Location = new Point(portal.GetcoordX(), portal.GetCoordY());
        }
Пример #2
0
        //Generador de objetos de tipo Soul;
        public void objectSoulGenerate()
        {
            //Alma número uno.
            soulOne.SetCoordX(xGenerateCoordinate());
            soulOne.SetCoordY(yGenerateCoordinate());
            ptbSoulOne.Location = new Point(soulOne.GetcoordX(), soulOne.GetCoordY());

            //Alma número dos.
            soulTwo.SetCoordX(xGenerateCoordinate());
            soulTwo.SetCoordY(yGenerateCoordinate());
            pbtSoulTwo.Location = new Point(soulTwo.GetcoordX(), soulTwo.GetCoordY());

            //Alma número tres.
            soulThree.SetCoordX(xGenerateCoordinate());
            soulThree.SetCoordY(yGenerateCoordinate());
            pbtSoulThree.Location = new Point(soulThree.GetcoordX(), soulThree.GetCoordY());

            //Alma número cuatro.
            soulFour.SetCoordX(xGenerateCoordinate());
            soulFour.SetCoordY(yGenerateCoordinate());
            pbtSoulFour.Location = new Point(soulFour.GetcoordX(), soulFour.GetCoordY());

            //Alma número cinco.
            soulFive.SetCoordX(xGenerateCoordinate());
            soulFive.SetCoordY(yGenerateCoordinate());
            pbtSoulFive.Location = new Point(soulFive.GetcoordX(), soulFive.GetCoordY());

            //Alma número seis.
            soulSix.SetCoordX(xGenerateCoordinate());
            soulSix.SetCoordY(yGenerateCoordinate());
            pbtSoulSix.Location = new Point(soulSix.GetcoordX(), soulSix.GetCoordY());

            //Portal
            portal.SetCoordX(xGenerateCoordinate());
            portal.SetCoordY(yGenerateCoordinate());
            ptbPortal.Location = new Point(portal.GetcoordX(), portal.GetCoordY());
        }
Пример #3
0
 //Método que controla el movimiento del usuario.
 private void InteractionDetection_Tick_1(object sender, EventArgs e)
 {
     if (((ptbPlayer.Left + ptbPlayer.Width) == (ptbSoulOne.Left + ptbSoulOne.Width)) && ((ptbPlayer.Location.Y + ptbPlayer.Height + 4) == (ptbSoulOne.Location.Y + ptbSoulOne.Height)) && ptbSoulOne.Visible != false)
     {
         ptbSoulOne.Visible = false;
         CounterForPoints();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (pbtSoulTwo.Left + pbtSoulTwo.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (soulTwo.GetCoordY() + pbtSoulTwo.Height)) && pbtSoulTwo.Visible != false)
     {
         pbtSoulTwo.Visible = false;
         CounterForPoints();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (pbtSoulThree.Left + pbtSoulThree.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (soulThree.GetCoordY() + pbtSoulThree.Height)) && pbtSoulThree.Visible != false)
     {
         pbtSoulThree.Visible = false;
         CounterForPoints();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (pbtSoulFour.Left + pbtSoulFour.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (soulFour.GetCoordY() + pbtSoulFour.Height)) && pbtSoulFour.Visible != false)
     {
         pbtSoulFour.Visible = false;
         CounterForPoints();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (pbtSoulFive.Left + pbtSoulFive.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (soulFive.GetCoordY() + pbtSoulFive.Height)) && pbtSoulFive.Visible != false)
     {
         pbtSoulFive.Visible = false;
         CounterForPoints();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (pbtSoulSix.Left + pbtSoulSix.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (soulSix.GetCoordY() + pbtSoulSix.Height)) && pbtSoulSix.Visible != false)
     {
         pbtSoulSix.Visible = false;
         CounterForPoints();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (ptbPortal.Left + ptbPortal.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (portal.GetCoordY() + ptbPortal.Height)))
     {
         if (EvaluateRecolection() == true)
         {
             player.SetPointsPlayer(pointsUser + 50);
             moveUser.Enabled = false;
             moveUser.Stop();
             InteractionDetection.Enabled = false;
             InteractionDetection.Stop();
             this.Hide();
             LevelFourForm levelFour = new LevelFourForm(this.player, this.questions);
             levelFour.ShowDialog();
         }
         else
         {
             pointsUser     = pointsUser - 5;
             lblPoints.Text = Convert.ToString(pointsUser);
             MessageBox.Show("¡Error!", "¡Aún no ha recolectado todas las almas!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (ptbBadFour.Left + ptbBadFour.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (badFour.GetCoordY() + ptbBadFour.Height)))
     {
         ptbBadFour.Visible = false;
         Reaction();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (ptbBadOne.Left + ptbBadOne.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (badOne.GetCoordY() + ptbBadOne.Height)))
     {
         ptbBadOne.Visible = false;
         Reaction();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (ptbBadTwo.Left + ptbBadTwo.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (badTwo.GetCoordY() + ptbBadTwo.Height)))
     {
         ptbBadTwo.Visible = false;
         Reaction();
     }
     else if (((ptbPlayer.Left + ptbPlayer.Width) == (ptbBadThree.Left + ptbBadThree.Width)) && ((player.GetCoordY() + ptbPlayer.Height) == (badThree.GetCoordY() + ptbBadThree.Height)))
     {
         ptbBadThree.Visible = false;
         Reaction();
     }
 }
Пример #4
0
        //Generador de objetos de tipo Soul;
        public void objectSoulGenerate()
        {
            //Random del usuario.
            player.SetCoordX(xGenerateCoordinate());
            player.SetCoordY(yGenerateCoordinate());
            ptbPlayer.Location = new Point(player.GetCoordX(), player.GetCoordY());

            //Alma número uno.
            soulOne.SetCoordX(xGenerateCoordinate());
            soulOne.SetCoordY(yGenerateCoordinate());
            ptbSoulOne.Location = new Point(soulOne.GetcoordX(), soulOne.GetCoordY());

            //Alma número dos.
            soulTwo.SetCoordX(xGenerateCoordinate());
            soulTwo.SetCoordY(yGenerateCoordinate());
            pbtSoulTwo.Location = new Point(soulTwo.GetcoordX(), soulTwo.GetCoordY());

            //Alma número tres.
            soulThree.SetCoordX(xGenerateCoordinate());
            soulThree.SetCoordY(yGenerateCoordinate());
            pbtSoulThree.Location = new Point(soulThree.GetcoordX(), soulThree.GetCoordY());

            //Alma número cuatro.
            soulFour.SetCoordX(xGenerateCoordinate());
            soulFour.SetCoordY(yGenerateCoordinate());
            pbtSoulFour.Location = new Point(soulFour.GetcoordX(), soulFour.GetCoordY());

            //Alma número cinco.
            soulFive.SetCoordX(xGenerateCoordinate());
            soulFive.SetCoordY(yGenerateCoordinate());
            pbtSoulFive.Location = new Point(soulFive.GetcoordX(), soulFive.GetCoordY());

            //Alma número seis.
            soulSix.SetCoordX(xGenerateCoordinate());
            soulSix.SetCoordY(yGenerateCoordinate());
            pbtSoulSix.Location = new Point(soulSix.GetcoordX(), soulSix.GetCoordY());

            //Denomino número cuatro.
            badFour.SetCoordX(xGenerateCoordinate());
            badFour.SetCoordY(yGenerateCoordinate());
            ptbBadFour.Location = new Point(badFour.GetcoordX(), badFour.GetCoordY());

            //Denomino número uno.
            badOne.SetCoordX(xGenerateCoordinate());
            badOne.SetCoordY(yGenerateCoordinate());
            ptbBadOne.Location = new Point(badFour.GetcoordX(), badFour.GetCoordY());

            //Denomino número dos.
            badTwo.SetCoordX(xGenerateCoordinate());
            badTwo.SetCoordY(yGenerateCoordinate());
            ptbBadTwo.Location = new Point(badTwo.GetcoordX(), badTwo.GetCoordY());

            //Denomino número tres.
            badThree.SetCoordX(xGenerateCoordinate());
            badThree.SetCoordY(yGenerateCoordinate());
            ptbBadThree.Location = new Point(badThree.GetcoordX(), badThree.GetCoordY());

            //Demonio número cuatro.
            badFour.SetCoordX(xGenerateCoordinate());
            badFour.SetCoordY(yGenerateCoordinate());
            ptbBadFour.Location = new Point(badFour.GetcoordX(), badFour.GetCoordY());

            //Demonio número cinco.
            badFive.SetCoordX(xGenerateCoordinate());
            badFive.SetCoordY(yGenerateCoordinate());
            ptbBadFive.Location = new Point(badFive.GetcoordX(), badFive.GetCoordY());

            //Demonio número seis.
            badSix.SetCoordX(xGenerateCoordinate());
            badSix.SetCoordY(yGenerateCoordinate());
            ptbBadSix.Location = new Point(badSix.GetcoordX(), badSix.GetCoordY());

            //Demonio número siete.
            badSeven.SetCoordX(xGenerateCoordinate());
            badSeven.SetCoordY(yGenerateCoordinate());
            ptbBadSeven.Location = new Point(badSeven.GetcoordX(), badSeven.GetCoordY());

            //Demonio número ocho.
            badEight.SetCoordX(xGenerateCoordinate());
            badEight.SetCoordY(yGenerateCoordinate());
            ptbEight.Location = new Point(badEight.GetcoordX(), badEight.GetCoordY());

            //Demonio número nueve.
            badNine.SetCoordX(xGenerateCoordinate());
            badNine.SetCoordY(yGenerateCoordinate());
            ptbNine.Location = new Point(badNine.GetcoordX(), badNine.GetCoordY());

            //Demonio número diez.
            badTen.SetCoordX(xGenerateCoordinate());
            badTen.SetCoordY(yGenerateCoordinate());
            ptbTen.Location = new Point(badTen.GetcoordX(), badTen.GetCoordY());

            //Demonio número once.s
            badEleven.SetCoordX(xGenerateCoordinate());
            badEleven.SetCoordY(yGenerateCoordinate());
            ptbEleven.Location = new Point(badEleven.GetcoordX(), badEleven.GetCoordY());

            //Demonio número doce.
            badTwelve.SetCoordX(xGenerateCoordinate());
            badTwelve.SetCoordY(yGenerateCoordinate());
            ptbTwelve.Location = new Point(badTwelve.GetcoordX(), badTwelve.GetCoordY());

            //Portal
            portal.SetCoordX(xGenerateCoordinate());
            portal.SetCoordY(yGenerateCoordinate());
            ptbPortal.Location = new Point(portal.GetcoordX(), portal.GetCoordY());
        }