public HPsistem(Rectangle pos, Rectangle posl, int vida) { icon = new BasicSprite(pos, new Rectangle(0, 0, 30, 30)); this.vida = vida * 5; vid = new Rectangle(pos.X + pos.Width + 5, pos.Y, this.vida, pos.Height); life = new BasicSprite(vid, new Rectangle(0, 0, 30, 30)); }
public Car(Rectangle pos, Rectangle posL, bool prote) : base(pos, new Rectangle(0, 0, 80, 47)) { this.pos = pos; speed = 5; int amountVida = 80; this.prote = prote; vivo = true; if (prote) { proteccion = new BasicSprite(pos, new Rectangle()); amountVida += 20; } vida = new HPsistem(posL, new Rectangle(5, 5, 10, 10), amountVida); }