public double drawEffectLine(Location baseLocation, Vector path, EffectPlayer effect, double alreadyTraveled, double limit){ double length = path.length(); Location currentLocation = baseLocation; Vector vector = path; vector.normalize(); for(; length >= 1; length--){ currentLocation.add(vector); effect.play(currentLocation); alreadyTraveled++; if(alreadyTraveled >= limit) { break; } } return alreadyTraveled; }