Help with some logic issues (it seems to be out of my league!)
scitunes
Member, Sous Chef Posts: 4,047
I am trying to make a game with similar physics to angry birds (with a major twist!)
I've got the sling shot down perfectly (well as good as it needs to be), but I want to have the little smoke puffs that spawn as you fly through the air. That is easy to do of course, but what I can't figure out is how to get it so it only shows the last set of smoke puffs each time. This is really important because it shows the trajectory from the previous shot so you can make adjustments to the next shot. But if the smoke puffs from all previous shots remain in the scene it gets really cluttered and hard to figure out which shot went with which puffs.
Any ideas how to set it up so that only the last set of smoke puffs are visible? Modulus or something?
Thanks!
I've got the sling shot down perfectly (well as good as it needs to be), but I want to have the little smoke puffs that spawn as you fly through the air. That is easy to do of course, but what I can't figure out is how to get it so it only shows the last set of smoke puffs each time. This is really important because it shows the trajectory from the previous shot so you can make adjustments to the next shot. But if the smoke puffs from all previous shots remain in the scene it gets really cluttered and hard to figure out which shot went with which puffs.
Any ideas how to set it up so that only the last set of smoke puffs are visible? Modulus or something?
Thanks!
Comments
So
when attribute = 1
spawn marker1
destroy marker2
When attribute = 2
spawn marker2
destroy marker1
something like that!
FMG, you lurking around here anywhere? Could use your math brain right about now!
Here's the basics.
Create an integer attribute (game.modulusthingy) set it to 0
Decide when the attribute will change (for me it is when the sling shot is fired)
so in the projectile I have a rule that says
When touch is released
change game.modulusthingy to (game.modulusthingy+1)%3 (This will cause game.modulusthingy to cycle through 0, 1, 2
Then I created three dot actors dot0 dot1 dot2
I have rules in the projectile that say when game.modulusthingy=0 spawn dot0, when game.modulusthingy=1 spawn dot1 when game.modulusthingy=2 spawn dot2
Then in dot0 I have a rule that says when game.modulusthingy=1 destroy
In dot1 I have a rule that says when game.modulusthingy=2 destroy
In dot2 I have a rule that says when game.modulusthingy=0 destroy
You can put a timer around the destroy. I actually put a timer around the destroy and used interpolate to fade out the alpha before destroying. Haven't tried this on a device as this project will be for web only but putting timers in a bunch of spawned dots could cause memory problems so you may want to skip that.