I have been stuck, trying to figure out this: I have a bunch of spawning objects outside the layout and I d like them to spit projectiles in random order.
I saved their X coordinates in a array and set up a function to pair the right y value for each x value that is randomly picked (so the projectile spawn exactly in the middle of the spamming object), like this:
The problem is that only 3 out of 4/5 spawning points work, I connot figure out why....
Develop games in your browser. Powerful, performant & highly capable.
Why are you doing this in such a complex and obscure way? Why not simply pick a random instance of the object and use it to spawn the projectile?
System pick random Hyve
...Hyve spawn Projectile
...Projectile set angle of motion to
If you need, you can first pick instances of Hyve with IIDs 184-190 in this event. Although, hard-coding IIDs in events is a bad practice, it's better to use instance variables.
Here is a demo I made quite a while ago for some other post, see comments in the code:
Thank you, I will try that.
I designed that way because I am learning the software, I am not so much into math/program. Thank you again!