Ejemplo n.º 1
0
        public void agregarExplosion(Delincuente d)
        {
            explosion.Image     = Properties.Resources.bum2;
            explosion.Location  = new Point(d.Location.X, d.Location.Y);
            explosion.Size      = new Size(d.Width, d.Height);
            explosion.SizeMode  = PictureBoxSizeMode.StretchImage;
            explosion.BackColor = Color.Transparent;
            explosion.BringToFront();
            this.Controls.Add(explosion);

            this.timer.Interval = 500;

            this.timer.Start();
            this.timer.Tick += new System.EventHandler(timer_explosion);
        }
Ejemplo n.º 2
0
        public void agregarDelincuentes(Point pos, int velocidad, Size tam, int i)
        {
            Delincuente d = new Delincuente(velocidad);

            this.Controls.Add(d);
            d.Location  = pos;
            d.Size      = tam;
            d.SizeMode  = PictureBoxSizeMode.StretchImage;
            d.TabIndex  = 0;
            d.TabStop   = false;
            d.Click    += new System.EventHandler(d.delincuente_Click);
            d.BackColor = Color.Transparent;
            d.Index     = i;
            d.BringToFront();
            d.Click += new EventHandler(this.clicker);
            delincuentes.Add(d);
        }
Ejemplo n.º 3
0
 private void superposicionDeImgs(Delincuente d)
 {
     if (d.Location.X < game.edificio2.Location.X + game.edificio2.Width && d.getVelocidad() < 0)
     {
         d.SendToBack();
     }
     else
     {
         if (d.Location.X < game.caja3.Location.X + game.caja3.Width && d.Location.X + d.Width > game.caja3.Location.X && d.getVelocidad() < 0)
         {
             d.SendToBack();
         }
         else
         {
             d.BringToFront();
         }
     }
 }