Touch release or outside, timer begins?

JacobGearyJacobGeary Member Posts: 11
edited November -1 in Working with GS (Mac)
Hey, so basically I have a bunch of boxes scrolling down onto the screen and I want a timer to start when your finger is either not touching or touching outside of these boxes and when the timer reaches 3 I want the scene to reset. Also when the boxes are touched I want this timer to reset.

I made a rule on the boxes saying

if touch is pressed and inside box, constrain attribute-"gametimer" to 0, timer-every 1 second set "gamescore" to "gamescore+1"

(I have a gamescore attribute). This all works fine..Then I have an attribute called "gametimer" and a rule on the boxes saying

if touch is released or outside, timer-every 1 second change "gametimer" to "gametimer+1".

Then I have another rule on a different object saying

"if gametimer=3 reset scene"

For some reason however, whenever I drag the finger off of the box it resets right away. and sometimes even when my finger is dragging along inside of the moving boxes my scene will reset....any thoughts??

would be greatly appreciated haha

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    It's because every block on the screen adds 1 to your game timer as soon as you release your touch

    Why not just set a timer in a controller actor that just runs every 1 second change attribute gametimer to gametimer+1
    The only difference is the timer would keep running even when your finger is touching the screen
    Your touches could still keep reseting timer to 0. I'm guessing this is a tap all of the blocks as they fall type game.

    ___________________________________________________________________________________
    BubbleBall Template HERE!!

    AppSolute Entertainment on Facebook
  • POMPOM Member Posts: 2,599
    It might be what @tenrdrmer said check it out,
    If it's not solve the issue then I guess the rule of "outside" is what causing this, think of it for a second, you have a bunch of boxes on the screen, you touch one of them (to drag it) but as you touch one of them you also touch "outside" the rest of them, which triggers your rule, try removing the "outside" rule and see if it solves the problem..

    Roy.
  • JacobGearyJacobGeary Member Posts: 11
    Thanks Tenrdrmer, what you said worked perfectly, never even thought of that and ya its kind of like a bunch of blocks coming down and your fingers are acting as legs and if your legs are off or outside the blocks a timer begins and if that timer reaches a certain amount you die. But ya it worked thank you!
Sign In or Register to comment.