I’ve been following some youtube tutorials and even a thread in here on creating enemies that shoot. I gave it a go and this was my result.
Obviously I’ve done something wrong but not sure what.
Also worth noting this is the first time I’ve coded so I need things explained in an easy way.
Why 1st and 4th codes have exactly same conditions and different Actions?
Why are you using text variables instead of value?
I made some adjustments
It is now firing the shot each time it collides with the hidden trigger “firePoint”
I know I need to add a delta time to it so it fade after a period of time.
But there is a solid shot constantly on screen where it generates from.
Simple answer is because I don’t know what I’m doing
Like I say, this is my first ever real coding!
The timer you added in your code is doing nothing. I dont understand what its supposed to do.
I got that from the tutorial. At this point I’m taking some thing very literally.
What I was hoping for was rather than each time the fly hit the trigger to shoot that I just added the shot would come from a timer instead, randomised a bit more so the player had to engage it different to the other enemies. Ultimately I’d like to make a boss based from it that fires several shots and Hass a basic follow player AI or something.
And change the RandomInRange values to fit what you want.
Good values for RandominRange maybe are (0.3,20)
Which timer did you use to set this up with?
Timers and Time > Value of a scene timer
Like this and the just add in the shot and its collision ect?
Just realise that I put both condition and action on same line, so split them out.
Added in the collision.
Shot doesn’t seem to be generating.
Upload your project to mediafire and I check it for you.
thank you for the offer, but I really want to learn how to do this myself.
Excellent choice! Try and error is the best!
I’m currently watching a space shooter tutorial to see what I can learn and apply through there.
Sorry, been extra busy so I haven’t been making as much.
I have changed the spawning point, by adding one in won the shoot fly > edit object > edit points > create point (ShotSpawn)
yet still no luck.
I think I may have missed a command or something for it to generate
I changed the Add action to create rather than among, no affect
Changed the linkage to the object/sprite in the add action; still no luck
Changed up the code a bit, had the wrong things selected, such as creating ShootFly rather than shot and now it is generating object, but still need a bit more work to finesse whats happening.
Ok, so it all works, kind of. the issue is that its generating a continuous stream of “Shots” from the spawning point. So that is what needs adjusting