public void calculateLoS()
    {
        lineOfSight.reset();
        int Xx;
        int Yy;
        int d;
        int dr;
        int dx;
        int dy;
        boolean yes;
        int resolution = 18;
        
        for (int i = 0; i < resolution; i++)
        {
            Xx = (int)world.x-world.viewX;
            Yy = (int)world.y-World.head-world.viewY;
            yes = true;
            d = 0;
            dr = i*(360/resolution);
            dx = (int)world.lengthdir_x(8, dr);
            dy = (int)world.lengthdir_y(8, dr);
            while (yes)
            {
                d++;
                Xx+=dx;
                Yy+=dy;
                if (world.isSolid(Xx+world.viewX, Yy+world.viewY))
                {
                    lineOfSight.addPoint(Xx, Yy);
                    yes = false;
                }
                if (d>=40)
                {
                    lineOfSight.addPoint(Xx, Yy);
                    yes = false;
                }
            }
        }
        hideFromMe.reset();
        if (!world.dead)
        {
            //cantSee = new RadialGradientPaint(world.x-world.viewX,world.y-world.viewY,250f,new float[]{0f,1f},new Color[]{new Color(0,0,0,0),new Color(0,0,0,255)});
            Area swag = new Area(lineOfSight);
            hideFromMe.add(box);
            hideFromMe.subtract(swag);
        }
        
    }