Sorry for asking an ambiguous question. Like the golden axe video, I want to implement the boomerang returning to the parent character.I swear I'm going to ban the next person that uses the words "is it possible" in a question.
Seriously, of course you can. There's a couple of different techniques, and they'll depend on a couple of factors:
- What happens when the boomerang hits a target? Does it bounce and return, or just plow through them. Don't forget behavior in return flight.
- Can the parent entity move after throwing or do they wait to catch?
- Do you want a catch animation or does the boomerang just dissapear (like in Ninja Gaiden).
See my project below. In mine, Tyris can throw her sword like Sara from Golden Axe III. She can't move again until she catches it. The sword bounces back when it hits going out. If already returning, it can still hit targets but keeps trajectory.
Tell us exactly how you want yours to behave and we can go from there.
DC
8. Captain's multi hit shield throw
Captain can throw auto target shield which could hit multiple enemies before returning to him by performing FREESPECIAL4 (Down Forward Attack).
Required stuffs:
8.1. ShieldChase.
8.1.1. It has animationscript data/scripts/harden.c to support its chasing mechanic.
8.1.2. It has didhitscript data/scripts/boomer.c to support its hitting counter and return mechanic.
8.2. spawner function which can be called from script.c declared with animationscript data/scripts/script.c in capamerica.txt. This function is used to spawn the shield and give the shield a parent for it to know who to return to.
Extra notes:
8.3. ShieldChase has target 2 2 0 0 1 0 which means it's moving at 2 pixels per centisecond speed max in x or z axis.
8.4. If ShieldChase were spawned when there were no enemies, it will float still until it's "fly time" is over. When it happened, it will return to Captain.
8.5. Captain's catch shield is just gimmick. It's not synched with ShieldChase's return mechanic at all.
8.6. If ShieldChase were spawned without spawner function causing not to have any parent, it will fly left/right until it's gone offscreen.