Projectile spawn/destroy
innaf
Member, PRO Posts: 5
in Help Wanted
Hi guys, i have a turret that shoots 10 balls, and after that i want each ball to be destroyed every 1 sec but somehow if i use destroy actor it destroys all the balls in like 2 sec. Anyone have some ideas?
Comments
Without seeing your rules, it's impossible to know why something isn't working right. Here's what I suggest: in the ball actor, have a Change Attribute behavior to change game.ballCount (integer) to game.ballCount+1. This behavior should NOT be inside of a rule but rather at the top of the rules list. Have a rule that says When attribute game.ballCount>10, and inside of that rule have a Timer that is set to After 1 second with a Destroy Actor behavior inside of the timer.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
http://i.imgur.com/jCXsM85.png?1 here is the rule, the game.Total is the same like the game.ballCount. The problem is that destroy actor actually destroy all the balls at once.
Basically i want it to destroy the first ball then second and so on
I have an idea to your question. I hope I understand the question correctly. You could use an invisible actor shaped like a hollow circle around the turret, and set a rule for the ball to be destroyed when colliding with the circle actor
To explain it more, the turret shoots balls every 0,5sec at player and the balls bounce all over the scene, and i want to have max 10 balls so after 5 sec the first shot ball should be destroyed and new one spawned. But now after 5 sec they are being randomly destroyed
If you are spawning the balls add a timer behavior to the prototype actors that says:
So each ball fired would destroy itself after 5 seconds on screen, they would destroy themselves in the order they are fired.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
got it now, thank you!