I am having a bit of an issue with my shooter here, let me explain :
So far so good, but here comes the part I can t really figure out how to do
I managed to get a semi-working multi lock-on system, but when I release the left trigger, only one missile is spawned and goes toward the first acquired target but not the others.
Any hint on how I could make that happen.
Thanks in advance.
PS : I am a huge beginner so please bare with my possible stupidity
That sounds like it's just an error somewhere, since it works with one. But it's hard to find an error with just a description.
Can you make a stripped down version of just those routines to upload? (you may find the problem when you are stripping it down. Which happens a lot.)
My off the cuff plan of how I'd do it would be to:
1. Have the player mark each of the enemy to target.
2. Then "for each" on the marks, so it will cycle through each.
3. spawn a missile and give it an instance variable to hold the UID of it's target.
4. as the missile flies have it turn 1 to 3 degrees toward the target until it hits something.
I did missiles like that in Orbital Bomb Bounder, and I believe I had a sine affecting the angle, so they wobbled a bit in flight.
Thank you very much for your reply Paradox, your plan worked like a charm
I still have an issue, since the condition is on trigger down, the game spawn an infinite number of target/sprite on targets, I ll have to find a way to limit it at 1. Maybe a variable on the target/sprite itself?
Develop games in your browser. Powerful, performant & highly capable.
Can you add "Trigger once while true" to the event?
Or maybe check to see if that one is already targeted.
The variable may be easiest to implement.
(Another thing mine had in that game; they were bullets, so I was able to check distance traveled, which let me time them out when failing to catch the target.)