Ejemplo n.º 1
0
        public void F1(snake Snake)
        {
            FileStream      v  = new FileStream("date1.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
            BinaryFormatter bf = new BinaryFormatter();

            bf.Serialize(v, Snake);
            v.Close();
        }
Ejemplo n.º 2
0
        public snake F2()
        {
            FileStream      v      = new FileStream("date1.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
            BinaryFormatter bf     = new BinaryFormatter();
            snake           Snake2 = bf.Deserialize(v) as snake;

            v.Close();
            return(Snake2);
        }
Ejemplo n.º 3
0
 public Game(int a)
 {
     if (a == 1)
     {
         Snake        = new snake();
         wall         = new Wall(1);
         Snake.record = seri.F6();
         Game.speed   = 200;
     }
     else
     {
         Snake        = seri.F2();
         wall         = seri.F4();
         Snake.record = seri.F6();
     }
 }