I am in need of a more efficient code to make my bullets spawn a certain distance from my tower but still in the correct direction
public void addBullet() { List<unit> ammotoward = getObjectsInRange(maxRange, unit.class); if(ammotoward.size() != 0 && reload >= 0) { LazerAmmo bullet = new LazerAmmo(); getWorld().addObject(bullet, getX(),getY()); bullet.setRotation(getRotation()); reload -=reloadtimer; } if (reload < 0) { reload +=1; } }