To make a save code, you basically take all the things you want in the code, convert them to strings, give each thing its own little tidbit letter or code or whatever, mash it in, and then reverse the process when they -load.
Im working on one now, which saves one simple integer, but also making it require the same account. Randomizing the account name, picking random letters, making little ciphers inside the code itself is where it gets tricky.