Skip to content
Sign upLog in
← Back to Community

How can I make a game where you can login and it saves your progress in Python

Profile icon
PureAspiration

So I wanted to make a game, but I'm not sure how to save the player's level into a file with their usernames. Can someone show me how to do that?

Thanks!

Voters
Profile icon
AarnavAsudani
Profile icon
PureAspiration
Comments
hotnewtop
Profile icon
PattanAhmed

@PureAspiration
Hi,
You can use something called Database
There are many databases such as Mongo, etc
But I suggest you use Repl DB

For the tutorial, you can find that on your Repl:-
01

Additional:-
https://docs.repl.it/misc/database

That's it
Thanks!

Hope this helps

Profile icon
CodeLongAndPros

Use the replit db, it's better

Profile icon
PureAspiration

@CodeLongAndPros
I don't really understand how it works.

Profile icon
CodeLongAndPros

@PureAspiration
There’s a tutorial somewhere. Here is it: https://repl.it/talk/learn/Replit-DB/43305 EDIT: oh wait it’s node…

You can use my functions here (around line 20):
https://repl.it/@CodeLongAndPros/Spacers-Final#main.py

Profile icon
heyitsmarcus

I made a simple little Python script that commits a value to Repl's DB in Python, and I added a bunch of comments. If you have any questions, feel free to ask: https://repl.it/@heyitsmarcus/Use-ReplDB-in-Python#main.py

Profile icon
Coder100

Repl.it db

It's the easiest choice ig
Docs https://pypi.org/project/replit/

But please do note that no database will work on repl.it's terminal because of security things, so unless you want to make the database public, it will be very hard to make it work on the terminal.

Short example:

from replit import db db[input('username')] = { password: input('password'), score: 0 }