Touch to spawn actor, but actor does destroy after next touch?
alex.funari@gmail.com
Member, PRO Posts: 2
Hi guys,
Perhaps I'm stupid, this is probably a noob question, but here we go.
I setup a game where when you touch the screen an actor is spawned. The background is a transparent box, which is clickable, and it's set to
BACKDROP ACTOR
Rule - Actor receives touch is inside
change attribute game.Touches.Count 1
spawn actor
Actor 1 in front of actor
position game.Touches.Touch 1.X, game.Touches.Touch 1.Y relative to scene.
----------------------------------------
ACTOR 1
currently no rules
-------------------------------------
All it working well! However, I'm confused as to how to destroy the previously spawned "Actor 1" when I touch and spawn another one. As it is now, if I touch the screen 50 times, 50 "Actor 1's" will be spawned, I need the previous one to destroy when a new one is spawned. Only 1 "Actor 1" can remain on the screen.
Thanks,
Perhaps I'm stupid, this is probably a noob question, but here we go.
I setup a game where when you touch the screen an actor is spawned. The background is a transparent box, which is clickable, and it's set to
BACKDROP ACTOR
Rule - Actor receives touch is inside
change attribute game.Touches.Count 1
spawn actor
Actor 1 in front of actor
position game.Touches.Touch 1.X, game.Touches.Touch 1.Y relative to scene.
----------------------------------------
ACTOR 1
currently no rules
-------------------------------------
All it working well! However, I'm confused as to how to destroy the previously spawned "Actor 1" when I touch and spawn another one. As it is now, if I touch the screen 50 times, 50 "Actor 1's" will be spawned, I need the previous one to destroy when a new one is spawned. Only 1 "Actor 1" can remain on the screen.
Thanks,
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Try this instead.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User