示例#1
0
        Boolean EjeX = true, EjeY = true;  //Controla el moviento de la serpiente (para que no retorne en la misma direccion)

        public PantallaPrincipal()
        {
            InitializeComponent();
            Cabeza         = new Cuerpo(10, 10);
            comida         = new Comida();
            GrpAreaDeJuego = AreaDeJuego.CreateGraphics(); //Area donde se movera la serpiente.
        }
示例#2
0
 public void Crecer()
 {
     if (Siguiente == null)
     {
         Siguiente = new Cuerpo(this.IntX, this.IntY);
     }
     else
     {
         Siguiente.Crecer();
     }
 }
示例#3
0
        public void FinalizarJuego()
        {
            IntPuntuacion            = 0;
            TxtPuntos.Text           = "0";
            EjeX                     = true;
            EjeY                     = true;
            DireccionX               = 0;
            DireccionY               = 0;
            Cabeza                   = new Cuerpo(10, 10);
            comida                   = new Comida();
            PbrPuntosLogro.Maximum   = 10;
            PbrPuntosLogro.Minimum   = 0;
            PbrPuntosLogro.Value     = 0;
            LblLogrosAlcanzados.Text = "0";
            LblProximoLogro.Text     = "10 puntos";
            SoundPlayer simpleSound = new SoundPlayer(Directory.GetParent(Environment.CurrentDirectory).Parent.FullName + @"\Multimedia\Sonidos\GameOver.wav");

            simpleSound.Play();
            MessageBox.Show("Game Over!");
        }
示例#4
0
 public Cuerpo(int IntX, int IntY)
 {
     this.IntX = IntX;
     this.IntY = IntY;
     Siguiente = null;
 }