Trying to create a sudden death mechanic

Hey guys,

                I am currently doing my first project on Corona and it is just a simple game, i cant seem to figure out how to do this and hopefully you guys can help me :slight_smile:

when my player hits a stick the score resets to ‘0’ but when the score is ‘10000’ or over i want it to then show my alert screen (gameover), i have my alert screen when the timer reaches ‘0’ which works so i thought i could do it like this

if(score.text => ‘10000’) then

alert()

end

it seems i cannot use => like you can in C#. Can anybody help me out with this 

Thank You

Joey Ireland

I believe what you want is:

[lua]

if(tonumber(score.text) >= 10000) then

     alert()

end

[/lua]

 

This worked like a charm.

Thank you very much :slight_smile:

Glad I could help :slight_smile:

I believe what you want is:

[lua]

if(tonumber(score.text) >= 10000) then

     alert()

end

[/lua]

 

This worked like a charm.

Thank you very much :slight_smile:

Glad I could help :slight_smile: