#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# What is the best way to fix this problem?

Posts: 34Member
I'm making one of those hidden object game, and I want to add a 3 strike rule when you touch on a empty space. So when you find the object and touch it, everything is cool, but when you touch on something that's not the object you're looking for. You would get a one X . If you get 3 X's game over.

Right now I have it were when i touch on an empty space I get a X but when I touch on the object I still get an X.

• Posts: 2,313Member
first: you maybe should give some information about your problem in the title. the change will be bigger that someone will help you. (at least I am glad your title isn't HELP or something )

make a integer attribute (for now I call it game.integer)
inside the object you want to find first place a rule
if game.integer = 0 AND touch is pressed
change game.integer to 1
also place all the other behaviors you want here (maybe something like change position or destroy)
--otherwise
if game.integer /= (is not equal to) 0 AND touch is pressed
get an X

in the object you want to find next place this
if game.integer = 1 AND touch is pressed
change game.integer to 2
also place all the other behaviors you want here (maybe something like change position or destroy)
--otherwise
if game.integer /= (is not equal to) 1 AND touch is pressed
get an X

etc.

probably not the best way to do this but this should be a way (didn't tried it )

# ✮ Available for hire! [email protected] ✮

• Posts: 1,113Member
Check your rules in your object and make sure you don't have a rule in there that says when touch pressed = x or however your rules are set up.

If you could show how your rules are set up or a picture of them, then people would be able to help faster instead of throwing out suggestions to you. Just FYI for the future to get help faster.

He who knows nothing is closer to the truth than he whose mind is filled with falsehoods and errors.

• Posts: 9,914Member
edited October 2013
Okay here is how you do it simply.

Make an attribute Boolean called hidden.

In the hidden object make a rule

Rule

When touch is pressed

Change attribute HIDDEN to true

Otherwise

Change attribute HIDDEN to false

Now in an actor off scene make a rule

Rule

If HIDDEN is false If touch.count > 0. If strike is < 3

Change strike to strike +1
• Posts: 34Member
thanks!
• Posts: 9,914Member
No problem. Since you only want one object to know it was touched you can just use the touch count and an attribute to know if a touch is present on the screen and the attribute will tell you if the touch is on the object or objects. If you want more objects just add that same condition to them.