-3
\$\begingroup\$

In a lot of games, the player can save their progress. I have no clue how I would approach this and implement it into my game.
My only thought would be to make a new file called "progress," and add anything the player had done without saving, but I don't know how to add this to my game. Any ideas are appreciated.

\$\endgroup\$
  • \$\begingroup\$ This has been asked before. \$\endgroup\$ – Vaillancourt Jan 30 '18 at 13:49
  • 3
    \$\begingroup\$ I would like to help you, but "I don't know how to add this to my game" is not a proper problem description. Please be more specific about where you are stuck in the process of adding a savegame feature to your game. \$\endgroup\$ – Philipp Jan 30 '18 at 16:07
  • \$\begingroup\$ Also do you mean Tackle instead of attack? Poor game. \$\endgroup\$ – Sidar Jan 30 '18 at 18:18
  • \$\begingroup\$ @AlexandreVaillancourt that's C++, not java. \$\endgroup\$ – The Magician Jan 30 '18 at 22:27
  • 2
    \$\begingroup\$ @TheMagician I'm aware of that and it's the only reason why this question is not yet closed as a duplicate. Although the language is different, the concepts will be the same. You should improve your question and desctibe what is troubling you exactly because right now it's really unclear, as Philipp highlighted. \$\endgroup\$ – Vaillancourt Jan 30 '18 at 22:31
1
\$\begingroup\$

I'm just a hobbyist, but here's what I might do.

Create a "save game" button in whatever scene you want the player to be able to save from. When clicked, this button calls a save_game() method from your game class.

You can design this method to create a file with whatever structure you want. For example, you can store the player's position, current level, inventory, etc.

When loading a game, call a load_game() method from the game class which generates the game instance using this saved info.

\$\endgroup\$
  • \$\begingroup\$ One thing you might want to do is only save the player's XP from last checkpoint, special cutscenes, etc @dietestus \$\endgroup\$ – FreezePhoenix Jan 30 '18 at 13:36
  • \$\begingroup\$ @TheOneWhoMade the only problem is in a roleplaying game \$\endgroup\$ – The Magician Feb 1 '18 at 12:49
  • \$\begingroup\$ Yes, save each players stuff when and if they make it to a checkpoint @TheMagician \$\endgroup\$ – FreezePhoenix Feb 1 '18 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.