Touch to spawn actor, but actor does destroy after next touch?

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,

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Sort of like this?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • alex.funari@gmail.comalex.funari@gmail.com Member, PRO Posts: 2
    edited February 2014
    edit|| not working as needed, see below.
  • alex.funari@gmail.comalex.funari@gmail.com Member, PRO Posts: 2
    Hey actually, this isn't working well when testing on iPhone, it "clicks" on startup, thus causing a game over. The object of the game is to avoid certain areas and stay on the platform, if you click off the platform you "fall". It's overhead view. When I test it on the phone, there is a phantom "click" that instantly causes a game over. Please advise, thanks.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    That demo is not particularly robust... it was just a quick method of doing what you initially asked.

    Try this instead.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.