Exemplo n.º 1
0
 public AllTanks(ImageList imageList, Border border, Wall wall, BrokenWall brokenWall, int speed)
 {
     this.border     = border;
     this.wall       = wall;
     this.Speed      = speed;
     this.imageList  = imageList;
     this.brokenWall = brokenWall;
 }
Exemplo n.º 2
0
 public Apple(ImageList imageList, Border border, Wall wall, BrokenWall brokenWall)
 {
     this.border     = border;
     this.wall       = wall;
     this.brokenWall = brokenWall;
     CreateRandomLocation();
     this.imageList = imageList;
     ImageFile      = imageList.Images["Apple.png"];
 }
Exemplo n.º 3
0
 public Kolobok(ImageList imageList, Border border, Wall wall, BrokenWall brokenWall, int speed) :
     base(imageList, border, wall, brokenWall, speed)
 {
     Score           = 0;
     IsGameOver      = false;
     CurrentPosition = new Position(20, 20);
     LastPosition    = new Position(20, 20);
     Directions      = Direction.RIGHT;
     TanksView       = new KolobokView(imageList);
 }
Exemplo n.º 4
0
 public Tank(ImageList imageList, Border border, Wall wall, Kolobok kolobok, BrokenWall brokenWall,
             int speed) :
     base(imageList, border, wall, brokenWall, speed)
 {
     CreateRandomLocation();
     LastPosition          = new Position(CurrentPosition);
     Directions            = Direction.RIGHT;
     TanksView             = new TankView(imageList);
     kolobok.HitTankEvent += Shot_HitTankEvent;
     positionsOfTanks.Add(this);
 }
Exemplo n.º 5
0
        public Tanks()
        {
            InitializeComponent();
            timer1.Interval = 200;
            listOfObjects   = new BindingList <IObjects>();
            buf             = new Bitmap(Width, Height);
            g = Graphics.FromImage(buf);
            pictureBox1.Width  = width;
            pictureBox1.Height = height;
            border             = new Border(width, height, imageList1, g);
            border.HorizontalLineOfBorder(0);
            border.HorizontalLineOfBorder(height - 20);
            border.VerticalLineOfBorder(0);
            border.VerticalLineOfBorder(width - 20);
            wall       = new Wall(imageList1, g);
            brokenWall = new BrokenWall(imageList1, g);
            wall.AddBiglWall(80, 120, 60, 160);
            brokenWall.AddBiglWall(160, 200, 60, 160);
            wall.AddBiglWall(300, 340, 60, 140);
            wall.AddBiglWall(380, 420, 60, 140);
            brokenWall.AddBiglWall(500, 540, 60, 160);
            wall.AddBiglWall(580, 620, 60, 160);


            brokenWall.AddBiglWall(20, 80, 200, 240);
            brokenWall.AddBiglWall(120, 200, 200, 240);
            wall.AddBiglWall(240, 340, 180, 220);
            wall.AddBiglWall(380, 460, 180, 220);
            wall.AddBiglWall(500, 580, 200, 240);
            brokenWall.AddBiglWall(620, 680, 200, 240);


            wall.AddBiglWall(80, 120, 280, 340);
            wall.AddBiglWall(160, 200, 280, 340);
            wall.AddBiglWall(300, 340, 260, 340);
            wall.AddBiglWall(380, 420, 260, 340);
            wall.AddBiglWall(340, 380, 280, 300);
            brokenWall.AddBiglWall(460, 500, 300, 380);
            brokenWall.AddBiglWall(580, 620, 300, 380);
            brokenWall.AddBiglWall(500, 580, 300, 320);
            pictureBox1.Image = buf;
            timer1.Enabled    = false;
        }