Hi all,
Can someone please help me with some logic, I feel like I am stuck in a chicken and egg situation and getting myself confused.
At the moment my JSON files that store current game status are being created and populated as and when needed, which means if you play my game from start to finish in one continuous flow. Everything works fine and dandy.
However, in the event that the player quits the app and does not play it for a while. Whilst the game is loading I intend to show a 2 second splashscreen so I can invoke a function to read in the current game settings.
EG main.lua > splashScreen.lua > mainMenu.lua
Therefore my code NEEDS the files to exist to read them in, even such files are empty, yet my game has not created them yet and so is erroring.
So I am getting stuck.
I have never attempted anything like this before so on a massive learning curve and I apologise if the answer is simple but I’m missing it.
As part of the game files, do I create “empty” files and store them as part of the app, instead of having the app create them as and when needed. If the fact the file is empty still likely to cause me a problem, if I was to populated them with a term such as “NEW GAME”, I could run a if statement to determine things. Would that work.
At the moment I keep getting errors when “checking” if a file exists. I thought I could manage them in an if statement but the code is causing an exception before that is being handled.
I just don’t know the solution.
Thanks in advance.
Angela