Limiting Moves

We’re creating a Match-3 game in Corona SDK, and we’d like to limit the amount of moves(or turns) a player can make before a gameover in called. We’d also like to display it to the player. Can anyone help us accomplish this, as this is our first big project.

Hi @info776655,

The following tutorial should help you. Basically, what you’re suggesting is the same as displaying a score, except that you want to display the number of moves, and subtract 1 each time the player moves instead of adding some value to a score.

https://coronalabs.com/blog/2013/12/10/tutorial-howtosavescores/

Hope this helps,

Brent

So just do 

local playerTurns = 3

And then when you want you do 

playerTurns = playerTurns - 1

And then 

if playerTurns == 0 then Goto GameOver end

–SonicX278

Hi @info776655,

The following tutorial should help you. Basically, what you’re suggesting is the same as displaying a score, except that you want to display the number of moves, and subtract 1 each time the player moves instead of adding some value to a score.

https://coronalabs.com/blog/2013/12/10/tutorial-howtosavescores/

Hope this helps,

Brent

So just do 

local playerTurns = 3

And then when you want you do 

playerTurns = playerTurns - 1

And then 

if playerTurns == 0 then Goto GameOver end

–SonicX278