public cDamagePlayer(renderable player, cHealth playerHealth, int damageAmount, cCollider col)
 {
     pc       = player;
     pcHealth = playerHealth;
     damage   = damageAmount;
     collider = col;
 }
Esempio n. 2
0
 public cEnemyAI(int moveSpeed, cCollider c, renderable target, int dist)
 {
     speed        = moveSpeed;
     viewDistance = dist;
     collider     = c;
     this.target  = target;
     targetPos    = pickNewTargetLoc();
 }
        public bool collides(Rectangle otherRect, cCollider c1)
        {
            if (component)
            {
                if (this.rect == otherRect || !rRef.active || !c1.rRef.active)
                {
                    return(false);
                }
            }
            else
            {
                if (c1 == this)
                {
                    return(false);
                }
            }

            return(rect.IntersectsWith(otherRect));
        }
        public bool collides(cCollider c1)
        {
            if (component)
            {
                if (this.rRef == null || c1.rRef == null || c1 == this || !c1.rRef.active || !rRef.active)
                {
                    return(false);
                }
            }
            else
            {
                if (c1 == this)
                {
                    return(false);
                }
            }

            return(rect.IntersectsWith(c1.rect));
        }
Esempio n. 5
0
 public cKeyboardMoveandCollide(int speed, float sprintMultiplyer, cCollider c) : base(speed)
 {
     this.sprintMultiplyer = sprintMultiplyer;
     collider = c;
     wMan     = Managers.WorldManager.man;
 }