0 votes

I am making a match 3 game. I want to implement a lives system, there will be 4 lives, you use one life for starting a stage and you get one life after every 15 minutes. What, I am thinking is making a dictionary with a single key value pair and updating it. For adding lives back, I am thinking of starting a timer when a life gets cut and updating dictionary at the end of 15 minutes set in timer. If there are still lives remaining to be refilled the timer restarts if maximum lives are reached is stops. The problem is if the game is shut down then it will not update. What should I do to let this logic run even when the game is shut down and also send a notification when all lives are refilled?

in Engine by (31 points)

Could you possible use OS.getunixtime() store the time at the point of shut down and when the player loads in, compare the two ? not sure how you could go about tracking that and sending notifications outside of the game.

Thank you, for that time logic. If, I get some doubts, I will get back to you.

You should be aware that if you are going to store time record on user' device it can be altered easily, so the best way is to have a server which stores it, but it is a completely different story...
P.S. A small trick: you can use File.get_modified_time() to check if file was modified after it was written by your app ;)

I was thinking of using firebase to store all user info and time and all right now, I am using dictionaries to store data. I am a beginner with only a few months of experience in development, the data, I have in my game is information about level whether its unlocked and high score and all, information about boosters which can also be purchased and lives system as mentioned above, will uploading all this on database be better and can you point me in the right direction?

Of course, this info should be saved in database on your server. I'm not experienced in these questions either. I suppose you, or somebody else, should create a service which will serve this data through API to your game. And this service can be written on JavaScript on Node.js, or Python, or PHP - Godot can't do it.
If you can't do it yourself I would suggest make the version of your game without purchasing options and if the game would be successful then make second version with the help of backend programmer.
Or may be publishing platforms like Kongregate can handle this stuff... but I know no more.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.