float spread = GameplayState.player.gun.opt_spreading-GameplayState.player.gun.opt_spreading_add;
float rand = new Random().nextFloat()*6-3; //[-3..3]
vector_mouse.setTheta(vector_mouse.getTheta()+rand/5*spread); //rand/spread_max*(spread-spread_add)
n_x = vector_mouse.x;
n_y = vector_mouse.y;
bullet = new Line(this.x, this.y, curr_x, curr_y);
while(true) //set 2nd gradient line
{
curr_x += n_x; curr_y += n_y;
if (GameplayState.player.gun.opt_distance_is_power)
power_add += 0.1f+Elements.extractLevel(ITEM.P_GUN_DISTANCE_IS_POWER)*0.035f;
drawLine();
if (checkCollision() == 0)
{
float length = bullet.length();
if (length > 220)
{
length = 220;
original_line_render = true;
}
else
original_line_render = false;
fire_x = this.x;
fire_y = this.y;
while(new Line(x, y, fire_x, fire_y).length() <= length)
{
fire_x += n_x;
fire_y += n_y;
}
break;