Writing to Table Based on Touch?

richheibelrichheibel Member, PRO Posts: 8

Hi guys!

Thanks for all of your help with building my app so far, I've managed to get a working countdown timer working in a table now, and it corresponds properly with the hearts in my virtual pet app, but I'm struggling with resetting the timer, I was hoping someone might be able to help me here.

So basically the table starts at 14400 and counts down every second, 14400 seconds = 4 hours. Every time an hour passes, the virtual pet loses one heart. This is working absolutely fine, however, what I am wanting to do is make it so that when a game is played the timer goes back up.

I have a game set up whereby three objects fall and the goal is to tap them as many times as the player is able to within a 10 second period. Every time one of the objects is tapped I would like the timer to go up by 36 seconds. Is there any way of actually doing this?

I've attempted using a "change cell value" rule, but I'm not sure I've done it correctly:

This is one of the last things I need to do, so any help would be very much appreciated!

Thanks,

Rich

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Two things you need. Since a touch is a momentary condition, it can cut off the code from firing completely once the touch is off. So wrap the write to table in a timer set to for .03 seconds with run to completion checked and also add a save table behavior inside the timer after the write behavior. Leave the change velocity outside the timer.

  • richheibelrichheibel Member, PRO Posts: 8

    THANK YOU SO MUCH! That worked like a charm. I really appreciate the help!

Sign In or Register to comment.