Recycling Bullets/Actor Demo
AppsRacK
Member Posts: 346
I need some help and guidance on proper way of doing this. Lets say i have a ball actor and i place 5 of them on the scene. I have a button that will interpolate the ball inside the gameplay map and then i have a seperate button to fire it or change its velocity upward. The same happens with other bullets. Im cracking my brains out on how to do this and i ended up with a lot of attributes which i know is not the proper way. I want to check out Victorkin11's sample (http://gamesalad.com/game/3066) coz i think its the closes of what i want to do but it seems that the server update bug the "download Project" button so it doesn show on my browser.
Thanks in advance.
Thanks in advance.
Comments
Thanks again.
I don't have time to go into huge detail, but these are the basic principles:
Every time you press the fire button, a 'firecount' variable should go up by 1.
Then in each bullet (start position off-screen), when firecount is a certain number, have them change position to the player and move as a bullet would.
When offscreen, or if they've hit an enemy, move to their start position.
Each bullet will be an instance with a particular 'firecount' number that triggers it.
So bullet one will have the rule:
If firecount=1
Do bullet stuff
bullet 2 will have:
If firecount=2
do bullet stuff.
Then obviously reset the firecount on entry into a scene, and make sure that if you have 10 bullets, say, that when firecount > 10 change firecount to 1
I hope that helps, or pushes you in the right direction! Sorry I don't have time to give more details!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Thanks QS.