How to make it so when I click/touch an object it's gone

PsychoticStudiosPsychoticStudios Member Posts: 101
edited November -1 in Working with GS (Mac)
I just started using gamesalad today and never developed an app before. I have little knowledge of scripting so I thought this sounded perfect. Well I just found out I ain't the best artist either so I've decided thats the style of art in my game (poorly drawn blocks and ninjas). To cut to the chase I was wondering how to make it so I clicked one of my blocks it would disappear.

Comments

  • osucowboy18osucowboy18 Member Posts: 1,307
    Hey there, and welcome to GameSalad! Don't worry about not having any experience, you will figure out how to use this great piece of software in no time. To get you started, might I suggest you head on over to the Official GameSalad Cookbook YouTube Channel (http://www.youtube.com/user/gamesaladcookbook).

    Anyway, regarding your question, there are a couple of ways to do this.

    Option 1
    In the actor you want to disappear when you touch it, add this rule:

    When Actor Receives Event Touch Is Pressed...
    Add Behavior - Destroy Actor
    End Rule

    Doing this will remove the actor from the screen permanently while the game is being played. If you still want the actor in the game, but just not visible, then you may want to use option 2.

    Option 2
    In the actor you want to disappear when you touch it, add this rule:

    When Actor Receives Event Touch Is Pressed...
    Change Attribute: self(which is the actor's name).color.alpha to 0
    End Rule

    This simply makes that actor invisible once the user touches it.

    Hope that helps :)

    - Alex
  • PsychoticStudiosPsychoticStudios Member Posts: 101
    Thank you =]
Sign In or Register to comment.