Esempio n. 1
0
        private void InicializaObjetos()
        {
            Sprites = new List<ProtoSprite>();
            SpritesASeremDeletados = new List<ProtoSprite>();

            Tanque1 = new Tanque(0, 0.6f, 2, this, DimensaoDaTelaX, DimensaoDaTelaY);
            Tanque2 = new Tanque(0.95f, 0.6f, 2, this, DimensaoDaTelaX, DimensaoDaTelaY);
            Bandeira1 = new Bandeira(0.02f, 0.85f,1);
            Bandeira2 = new Bandeira(0.95f, 0.2f,2);
            PowerUp = new PowerUp(0.5f - 0.05f, 0.55f - 0.05f);
            Sprites.Add(Bandeira1);
            Sprites.Add(Bandeira2);
            Sprites.Add(PowerUp);
            Sprites.Add(Tanque1);
            Sprites.Add(Tanque2);

            for (int v = 0; v < 10; v++)
            {
                Sprites.Add(new Obstaculo(0.15f, 0.1f + 0.09f * v, this,1,1,(short)(v+1)));
                Sprites.Add(new Obstaculo(0.16f, 0.1f + 0.09f * v, this,1, 2, (short)(v + 1)));
                Sprites.Add(new Obstaculo(0.85f, 0.1f + 0.09f * v, this, 2, 1, (short)(v + 1)));
                Sprites.Add(new Obstaculo(0.86f, 0.1f + 0.09f * v, this, 2, 2, (short)(v + 1)));
                Sprites.Add(new Obstaculo(0.30f, 0.1f + 0.09f * v, this, 3, 1, (short)(v + 1)));
                Sprites.Add(new Obstaculo(0.31f, 0.1f + 0.09f * v, this, 3, 2, (short)(v + 1)));
                Sprites.Add(new Obstaculo(0.70f, 0.1f + 0.09f * v, this, 4, 1, (short)(v + 1)));
                Sprites.Add(new Obstaculo(0.71f, 0.1f + 0.09f * v, this, 4, 2, (short)(v + 1)));
            }
        }
Esempio n. 2
0
        private void PegaBandeira(Bandeira b)
        {
            if(b.Dono != Jogo.tanqueLocal){
                Jogo.DestroiSprite(b);

                Rede.EnviaMensagem15("J"+Jogo.tanqueLocal.ToString(),"B"+b.Dono.ToString());
            }
        }