Ejemplo n.º 1
0
        public void placePeaces()
        {
            for (i = 0; i < 12; i++)
                for (j = 0; j < 12; j++)
                {
                    switch (table[i, j])
                    {

                        case 1: play2[i, j] = new Enemy();
                            play[i, j].BackgroundImage = play2[i, j].Image;

                            break;



                        case 2: 
                                
                                break;
                   



                        case 3: play2[i, j] = new Hero(table[i, j]);
                                play[i, j].BackgroundImage = play2[i, j].Image;
                            break;
                        case 4: play2[i, j] = new Hero(table[i, j]);
                                play[i, j].BackgroundImage = play2[i, j].Image;
                            break;
                        case 5: play2[i,j] = new Hero(table[i,j]);
                            play[i, j].BackgroundImage = play2[i, j].Image;
                            break;
                        default: break;
                    }
                }
        }
Ejemplo n.º 2
0
        public void design_and_place()
        {
            
            int i, j;

            for (i = 0; i < 12; i++)
                for (j = 0; j < 12; j++)
                {
                    string value = Convert.ToString(i, 16);
                    string value2 = Convert.ToString(j, 16);
                    string value3 = value + value2;

                     
                    
                    switch (table[i, j])
                    {

                        case 1 :   play2[i,j] =  new Enemy(i,j);
                                   play[i, j].BackgroundImage = play2[i, j].Image;
                                   
                                   break;

                        case 2:    play2[i, j] = new Terrain();
                                   play[i,j].BackgroundImage = play2[i,j].getImage(table[i,j]);
                                                                  
                                   break;


                        
                        case 3:    play2[i,j] =  new Hero();
                                   play[i, j].BackgroundImage = play2[i,j].Image; 
                                   break;
                        default: break; 
                    }
                }


            

         

        }