Exemplo n.º 1
0
 void CriarBloco()
 {
     textoAnimator.Play("Aparecer");
     texto2.text = mensagens [1].ToUpper();
     Falar();
     GerJogo.AdicionarNaGrade(1, 1, 0);
     proximoTempo = Time.time + 1.5f;
 }
Exemplo n.º 2
0
 void AparecerBlocoNegativo()
 {
     GerJogo.AdicionarNaGrade(2, -1, 15);
     textoAnimator.Play("Aparecer");
     texto2.text = mensagens [3].ToUpper();
     Falar();
     proximoTempo = Time.time + 3;
 }
Exemplo n.º 3
0
 void DoisSub()
 {
     GerJogo.Limpar();
     esperandoJuntar     = true;
     podeInteragirBlocos = true;
     textoAnimator.Play("Aparecer");
     texto2.text = mensagens [9].ToUpper();
     Falar();
     GerJogo.AdicionarNaGrade(2, -1, 3);
     GerJogo.AdicionarNaGrade(2, -1, 12);
     proximoTempo = tempoRastro + Time.time;
 }
Exemplo n.º 4
0
 void BlocosIguais()
 {
     esperandoJuntar     = true;
     podeInteragirBlocos = true;
     //btRealizacoes.SetActive(false);
     textoAnimator.Play("Aparecer");
     texto2.text = mensagens [7].ToUpper();
     Falar();
     GerJogo.AdicionarNaGrade(1, 1, 15);
     GerJogo.AdicionarNaGrade(1, 1, 0);
     proximoTempo = tempoRastro + Time.time;
 }
Exemplo n.º 5
0
    public static void CarregarDados()
    {
        string carregar = CarregarStringDeArquivo();

        if (string.IsNullOrEmpty(carregar))
        {
            return;
        }

        //Utilidade.DebugMensagem ("Dados Carregados: "+carregar);

        string [] dados = carregar.Split(divisor[0]);

        int objts       = 0;
        int indiceAtual = 0;

        // Tempo e pontos
        Dados.tempoTotalDeJogo   = ulong.Parse(dados[indiceAtual]);
        Dados.pontosAtuais       = int.Parse(dados[indiceAtual + 1]);
        Dados.quantidadeDeResets = ulong.Parse(dados[indiceAtual + 2]);
        Dados.pontosTotaisReais  = ulong.Parse(dados[indiceAtual + 3]);
        Dados.tutorialCompleto   = bool.Parse(dados[indiceAtual + 4]);

        indiceAtual += 5;

        // Objetos no cenário
        objts  = int.Parse(dados[indiceAtual]) * 3;
        objts += indiceAtual;
        indiceAtual++;

        while (indiceAtual < objts)
        {
            int valor = int.Parse(dados[indiceAtual]);
            int tipo  = int.Parse(dados[indiceAtual + 1]);
            int pos   = int.Parse(dados[indiceAtual + 2]);

            GerJogo.AdicionarNaGrade(tipo, valor, pos);
            //Debug.Log ("Tipo "+tipo + ", Valor "+valor + ", pos "+pos );
            indiceAtual += 3;
        }

        // Missões
        objts  = int.Parse(dados[indiceAtual]) * 2;
        objts += indiceAtual;
        indiceAtual++;

        while (indiceAtual < objts)
        {
            int indice = int.Parse(dados[indiceAtual]);
            int nivel  = int.Parse(dados[indiceAtual + 1]);

            foreach (Missao m in Dados.missoes)
            {
                if ((int)m.tipo == indice)
                {
                    m.Nivel(nivel);
                    m.AjeitarValores();
                }
            }
            indiceAtual += 2;
        }

        // Realizações
        objts  = int.Parse(dados[indiceAtual]) * 3;
        objts += indiceAtual;
        indiceAtual++;

        while (indiceAtual < objts)
        {
            int  indice   = int.Parse(dados[indiceAtual]);
            bool completo = bool.Parse(dados[indiceAtual + 1]);
            long data     = long.Parse(dados[indiceAtual + 2]);

            foreach (Realizacao r in Dados.realizacoes)
            {
                if (r.indice == indice)
                {
                    r.completa     = completo;
                    r.dataCompleto = System.DateTime.FromFileTime(data);
                    break;
                }
            }

            indiceAtual += 3;
        }
    }