Continue when out program

I want my game to be able to continue playing (from where it was before quitting) when I quit Gdev. Now that I’m using Firebase, I’m curious to see if this is possible. Is there a sample clip? Any code recommendations for me?

You can’t make the game run after quitting, but what you can do is store the current time in storage when quitting the game. When reopening the game, compare the difference of time between the saved time of exit and the current time, and process everything that should’ve happened within this timeframe.

1 Like

Hello and welcome. What arthuro555 says is not as complicated as it sounds, depending on what you are trying to save or calculate. The position of objects in the game? Offline earnings? How many grains of wheat the mill should have produced? I’m sure there’s code recommendations if we know what you are trying to do.

Yes, I want to keep my latest data in the game before I close the program. And when I come in again, I want to give information in the game. It’s the latest information before I leave.
PS: My game is a platform game with many levels.

I’m developing a platform game with multiple levels. All I want is When I exited the game on level 5, when I re-entered with the same identity. I want it to go to level 5 and continue playing. I use the database which is firebase.

I thought you meant something like this, based on the way you worded “continue playing (from where it was before quitting)”.

So you want to use firebase to save this information rather than a local save on the device, so your players can continue where they left off even on another device? Would you want to create a back up save on the local device in case the player for some reason has to play offline and doesn’t want to slog thru 59 levels to get back where they were?

I can’t really help because I don’t know anything about firebase, just asking questions to help clarify what you want for the people that can help and point you in the right direction.

Sorry, I thought firebase would do that. But if you tell me like this I want to know So what if it’s not firebase? Can I do what I want? Do you have a way to do that? Or is there a code or clip as a guide?

Well I think of course you can do it with firebase. And you could also do it without firebase by using save and load events in your game. But those will only save on the machine. This post has some links to example projects using save and load events, links to videos, questions and explanations, and example code snippets for you to study.
[Solved] How do i save game progress? - How do I…? - GDevelop Forum

I did search a little for firebase stuff to recommend to you but didn’t see anything that seemed relevant. Probably wouldn’t hurt for you to check out the firebase example

Firebase example - a game example from the GDevelop game making app | GDevelop

And you can adapt what you learn to your own needs.