Example #1
0
 //---------------- MENSSAGENS DE COLISÕES DOS TIROS -----------
 /// <summary>
 /// Ouve a colisão do tiro com um obstaculo.
 /// </summary>
 /// <param name="obs"></param>
 /// <param name="t"></param>
 private void EnviaMsgColisaoObstaculo(Obstaculo obs, Tiro t)
 {
     string aux = string.Format("T|BL{0}{1}{2}|{3}", obs.GetColuna, obs.GetFileira, obs.GetBloco.ToString("00"), t.GetId);
     int qtd = aux.Length + 5;
     string msg = string.Format("15{0}{1}", qtd.ToString("000"), aux);
     this.frm_Inicio.EnviaMsgTcp(msg);
 }
Example #2
0
 private void Cria(float xIni, float yIni, float tX, float tY, int coluna)
 {
     int fileira = 1;
     int bloco = 1;
     float x = xIni;
     float y = yIni;
     Obstaculo obs;
     for (int j = 0; j < 2; j++)
     {
         for (int i = 0; i < 10; i++)
         {
             obs = new Obstaculo(x, y, tX, tY, coluna, fileira, bloco);
             listaObs.Add(obs);
             elementosJogo.Add(obs);
             y += tY;
             bloco += 1;
         }
         bloco = 1;
         fileira += 1;
         x += tX;
         y = yIni;
     }
 }