Explosion animation where actor was touched
jerlant360
Member Posts: 82
i have a falling actor who when is touched goes back again (recycled) the thing is i want that appears an explosion on the place where it was touched
Thanks guys
Thanks guys
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@jerlant360 Hi, not sure why the spawned explosion would follow your actor, unless you've put a Rule to tell it too...
Good advice from @FryingBaconStudio which should work fine without problems... OK, try something like this: put your Animate behaviour for the explosion in its own actor's rules as suggested
In the rules of your falling actor, put:
Rule when touch is pressed
Spawn Explosion
--- I'm sure you did that, but put its Position in the Spawn behaviour, x as game.Touches.Touch1.X and y: game.Touches.Touch1.Y Relative to scene
Then make sure your explosion actor to be spawned is set to not move, i.e Moveable unchecked in its Physics attributes.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
When touch is pressed,
Animate : (add frames)
Timer, after x amount of seconds,
Change attribute self.position X to (whatever)
Change attribute self.position Y to (whatever)
Maybe I'm missing something or don't understand the question fully...
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
In my game, I had missile launching into the air and at a certain point (i.e. touch), I Changed the Image to the first frame of my explosion, adjusted the size of the actor (Change Attribute Size X & Y), and then played the animation. On the last slide of the animation, I created a blank transparent slide. Upon the end of the animation (this took some trial and error with a timer), I used Change Attribute to recycle the actor back to a starting position (I recycled missiles - I had 15), reset the image back to a missile and changed the Size back to normal.
As I said above, I ended up with 15 missiles to permit the game to display a steady stream of missiles firing while also allowing enough time for the animation sequence to play and the missile actor to reset off-screen.
While it was a bit of a pain setting up all 15 missiles, it ended up being very efficient.
Note - you can include a rule within your falling actor to only be affected by Touch input in non-explosion mode, permitting spam-fingered players from affecting the actor while it's in it's explosion behavior..
- Cheers!