public bool collideRadius(Enemies.Enemy enemy) { float x = (enemy.getPos().X) - (position.X * gWidth); float y = (enemy.getPos().Y) - (position.Y * gHeight); int hyp = (int)Math.Sqrt((x * x) + (y * y)); if (hyp <= radius) return true; return false; }
public Bullet(int dmg, int spd, bool isFlying, bool isGround, bool isHoming, bool isPiercing, int x, int y, Texture2D sprite, int w, int h, Enemies.Enemy t) { flying = isFlying; ground = isGround; homing = isHoming; piercing = isPiercing; power = dmg; speed = spd; width = w; height = h; image = sprite; position = new Vector2(x,y); target = t; objectPosition = t.getPos(); angleChange(objectPosition); isDead = false; }