Setting a timer delay between game levels

I have an app with 35 levels, where kids drag a letter to make a 3-Letter word like “cat”. Currently, when they drag the last letter “t”, it will automatically take them to level 2, triggering the local function checkWin. What I would like to happen is that when the kid drags the last letter “t”, a timer is set for three seconds BEFORE it takes him to level 2. This allows the kid to actually see the entire word “cat” before he is taken to the next level. Can anyone help me with this timer/delay code?  Do I put it in my checkWin code section? Thanks!

~ John

Wherever you now call the function that loads the next level, use this instead:

[lua]

timer.performWithDelay(3000, loadNextLevelFunction) – 3000 milliseconds = 3 seconds

[/lua]

That should do it – but I’d suggest maybe a different user experience. When the kid wins, why not throw a big colorful arrow button on the right side of the screen? Let them decide when to go to the next level.

Because if they worked really hard and *finally* spelled CAT and they grab the iPad and run through the house to show Dad what they did – by the time they get to wherever he is, they have nothing to show because you decided that 3 seconds was the right amount of time.

Now that poor child is crying, and it’s your fault.

I hope you’re happy.

 Jay

Wherever you now call the function that loads the next level, use this instead:

[lua]

timer.performWithDelay(3000, loadNextLevelFunction) – 3000 milliseconds = 3 seconds

[/lua]

That should do it – but I’d suggest maybe a different user experience. When the kid wins, why not throw a big colorful arrow button on the right side of the screen? Let them decide when to go to the next level.

Because if they worked really hard and *finally* spelled CAT and they grab the iPad and run through the house to show Dad what they did – by the time they get to wherever he is, they have nothing to show because you decided that 3 seconds was the right amount of time.

Now that poor child is crying, and it’s your fault.

I hope you’re happy.

 Jay