Esempio n. 1
0
 public Hero(Rectangle pos, Rectangle posL) : base(pos, 6, new Rectangle(0, 0, 195, 349), 8, new Rectangle(0, 349, 205, 357), 9, new Rectangle(0, 704, 332, 347), "char_v")
 {
     if (pos == null || posL == null)
     {
         throw new NullReferenceException("parameter can't be null: pos or posL");
     }
     this.pos  = pos;
     speed     = 5;
     jumpSpeed = 9;
     vida      = new HPsistem(posL, new Rectangle(5, 5, 10, 10), 30);
 }
Esempio n. 2
0
        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);
        }