Destroy if table value = 0?

jsorr2jsorr2 Member Posts: 279
edited November 2014 in Working with GS (Mac)

Thats my code. I have it set so table value = number of apples on the screen. If the number hits 0 and the user double taps the apple, then destroy the apple. But if I destroy an apple once, I cannot collect it again until I restart the game. The apple image pops up for a second then disappears. The table value also changes from 0 to 1 (when I collect the apple), then back to 0 in a second. It works flawlessly, and I can collect up to 9 apples. it's just when I destroy it, it bugs out.

How come?

EDIT: it has something to do with the doubletap rule. I changed the logic to, if touch is pressed, destroy apple, and it worked fine.

Best Answer

  • gyroscopegyroscope I am here.Posts: 6,598
    edited November 2014 Accepted Answer

    Hi, at a quick guess: try adding in your Rule " Eat apple Doubletap" (before the Destroy behaviour):

    Change Attribute game.DoubleTap to 0

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Answers

  • jsorr2jsorr2 Member Posts: 279

    Hi Gyroscope, i came to a similar conclusion last night. Thank you for responding :D

Sign In or Register to comment.