Problem with score module

Hello guys

I need help:

I have a game divided in 10 levels, then I created 10 file.lua… in each level there is a man that run (and the time flow) , when he finishes to run the timer will pause and this should rapresent the score that the player done.

The problem is that when the man finish to run the game (through a storyboard) is redirected in another file.lua (the Winning page) that should show the Time (then the Score) that the player has done.

This score should be summed to the other Score that the player will do on the other 9 levels.

So the questions are two:

  1. How to show the Time ,made in a file.lua , to another one (for example file2.lua)?

  2. How can I sum all the scores made in all different levels??

Sorry for my bad english I hope you can help me.

PS: I prefer and example and please don’t tell me to read the Corona Docs bewcause I already did it and it wasn’t helpfull for me. Also if you have a good Tutorial for example a video I will be happy :slight_smile:

Have you seen this tutorial/blog post?

http://www.coronalabs.com/blog/2013/12/10/tutorial-displayingsavingloading-scores/

Rob

Yes but I was searching something esier because what I had in mind was something very simple and basilar

At the very basics, you need a variable that is “global”.  We don’t want you to use globals, which is why we recommend using a data module that gets loaded in every scene (See the Goodbye Globals tutorial: http://www.coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/).  That way you have a variable to hold your score.  The score module presented in the blog does this for you so you don’t have to maintain it yourself. 

Once you have the variable and you update it each level then in the end game scene, you can then display it as you would any other variable using display.newText(), send it to a high score service like GameCenter and save it as a high score (again the score module supports storing the score for you).

Rob

Have you seen this tutorial/blog post?

http://www.coronalabs.com/blog/2013/12/10/tutorial-displayingsavingloading-scores/

Rob

Yes but I was searching something esier because what I had in mind was something very simple and basilar

At the very basics, you need a variable that is “global”.  We don’t want you to use globals, which is why we recommend using a data module that gets loaded in every scene (See the Goodbye Globals tutorial: http://www.coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/).  That way you have a variable to hold your score.  The score module presented in the blog does this for you so you don’t have to maintain it yourself. 

Once you have the variable and you update it each level then in the end game scene, you can then display it as you would any other variable using display.newText(), send it to a high score service like GameCenter and save it as a high score (again the score module supports storing the score for you).

Rob