#How do i do a JSON based save and load system ?

1 messages · Page 1 of 1 (latest)

zinc vector
#

I want to do a save and load system for my game, but i dont know how, my design is like this:

The game detects player has died, meaning the value associted with health is equal or below 0
The game decides to check for the final score at the moment of death
The game writes down in the JSON files the final score in a list of final scores
The game also writes down the amount of coins won based on the final score, (which is pretty much if you get a final score of 250, you get 250 coins) in a history
The game calculates how much coins the player has based on its history, Ex: this player got 50 coins, then spent 25 coins, then got 50 coins so he got 75 coins right now)
If: player spends some coins
the game will add the transaction to the save file in a history
the game will then do yet another calculation

limpid coral
#

Read a file, serialize, deserialize, save to file. What exactly is the question?

zinc vector
#

oh so i need to use the read file, serialize, deserialize and save to file and that is it ? thanks, i will try that later

tender smelt
stuck fractal
#

Nav's video is awesome, you should check it out.

stuck fractal
#

OMG I've sent I wrong file.

zinc vector
#

what ?

stuck fractal
zinc vector
#

that will work ?

#

just that ?

stuck fractal
#

Just use this as a reference; it only applies to me.

zinc vector
#

oh ok