Nicely commented. Ty.
Sorry if i confused by trowing a ".cap in construction", i figured : Rather trow you something then let it be and go to bed.
Simplified a boomerang curve, you can state:
It travels a certain distance, leaving the pitcher and coming back to the pitcher, with decisions to make at certain points in the traveling distance.
At distance = 0 .. it leaves the pitcher at a angle of -30� (right handed)
At 1/3 of the distance it will turn 90 �
At 2/3 of the distance we just tell it to return to the pitcher
At distance completed it should come to rest.
Since Distance in all this is a key variable, i made that whole construction with pressing space bar and make it look like energy gets build up. But in fact i just choose a distance there.
But "distance" is not really controllable.
So well, i translated it to "time". Like you trow a boomerang and look at it holding a stopwatch, and when you know the total time that its traveling, you can say ..
at 1/3th of that time it turns 90�
at 2/3th of that time it returns to the pitcher.
'time' is growing with every tick.
Thats all the object "GoodBoom" is dooing.
Now event 20 and 21 was an attempt to make the 1st turn less "instantly". The angle the bullet behavior is facing is changed in steps to +- 90�.
If you make "GoodBoom" visible, you will see that it comes close to a Boomerang path.
But, i was not happy with the "cornysquary" path.
And since i had collisions and bouncing in mind between the BadMouse and the BadBoomerang, i made a Ball behavior for another object (Badbullet) to follow the object that makes the boomerang path.
Resulting in a smoother path, and later more options to make things bounce.
If you make the reactions of the ball behavior faster, it will follow the bullet more close.
Now the point to return ? Guess thats up to you.
I think there are 3 options.
Or it returns to the pitcher, and the pitcher is able to move while the boomerang is moving. But yes thats not really a boomerang path.
This is what it does in my .cap
It returns to pitcher, but we denie movement to the pitcher while the boomerang is moving.
The path is closer to the path of a boomerang. But i dont know if its ok in your game concept to have the player vulnerable to attacks while trowing.
It returns to the point it started. The player can move. But will have to pick up the boomerang to be able to trow it again.