If not redo the placement calculations on the prototype variables until you have acceptable values.
thanks for the reply..
so you are saying to create a loop and keep checking until you have acceptable parameters?
but what about the calculation?
player.x + turret.range + random(layout.width)
player.y + turret.range + random(layout.height)
say my layout is 800x800
and range is 300
and the player is at 700,750
the generated values would have to be approx between 0-400,0-450
if the player is at pos 20,100 then of course the regular calculation would work...
I probably have to do a bunch of checking I guess...like:
if player x is > (layout.width - range) then subtract range instead of adding range etc...
just wondering if there's an easier way to do it.