How can I get the bullets to 'self-destruct'
allaboutiweb
Member Posts: 42
I am designing a game based on the fantastic demo from Orbz, 'Shoot where touch XY' - http://gamesalad.com/game/3097 - I have also been trying for the last hour and a half to get the bullets to self-destruct when they reach XY but for the life of me can not get it to work.
Can anyone point me in the right direction....please.......
Can anyone point me in the right direction....please.......
Comments
OR you could say 'after 5 seconds - destroy bullet' (depending on how long the max time the bullets stay on screen is)
Hope that helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Its tough to get a rule to check if it is exactly at a given X,Y then destroy itself. You could check if the velocity of the X and Y are 0.
Also you can use interpolate behaviors to change the position which should give you the exact point to stop and eventually destroy itself.
OR you could check the magnitude between its position and the target position(as stored in self attributes) and if is is less than some small number, then destroy itself.
So, if self.position Y > 320 then destroy actor, for example.
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Sooooo I added another Timer attribute to the Movement rule under the 'otherwise' bit which, 'after' 0.1 seconds destroys the bullet too.
Once again, thanks for your help guys.
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io