Hi, i'm making a zelda like game and was trying to implement a boomerang where u shoot it, it goes a set distance and then returns to the user. I can shoot the bullet out ok but just not sure on how to implement the above.

The boomerang does look like its attached to a zip line in the 2d Zelda games if I recall correctly. First thing to do is store a boolean variable for the boomerang which says whether it is moving away or not, toggle it when it hits the maximum distance, or hits something.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

just outta curiosity frob, doesn't this also depend on the boomerang velocity and how much the player can move in a single update? It seems like if the motions were too rapid, you'd get a stutter with the motion. I guess attenuating the velocity would take care of that tho?

In general, without "real" physics you'd implement this sort of thing as a piece-wise algorithm, over a time variable 't' (time, ticks, frames, or whatever your game uses), for the first span of 't' units, you move toward the target destination, and then afterwards the boomarang moves toward the player (who might have moved from his initial position, or indeed still be moving).

For extra fun, you could give the boomerang momentum and not allow it to change direction too rapidly. Then the player can manouver to miss the boomerang and have it turn around and circle back towards him from the other side, hitting enemies all the while. This mechanic can be seen in the Windmill throwing star in the Ninja Gaiden games, and a skilled player could continually dodge its return, using it in interesting ways. I don't recal whether it was destroyed after hitting the first enemy or not, but it could be done either way.

Or if that mechanic doesn't fit, for another interesting mechanic, allow the boomerang to miss the player and fall to the ground on the same mechanics, but make the player pick it back up before using it again. This would have the gameplay effect of limiting the player's movement after he throws a boomerang, which would make the choice to use it or not carry an opportunity cost that makes things more interesting.