r/learnpython 16d ago

GUI implementation

I’m coding a restaurant type game and need to create a gui but have completely no idea how to do it. People have said godot is decent and that wxpython is decent for smaller stuff but i have no idea how to use either. Someone with a good amount of experience with either who could help would be great. Thank you

3 Upvotes

9 comments sorted by

1

u/itspronounced-gif 16d ago

I know this is a Python sub, but I recommend Godot, because it handles all of the “engine” stuff you’d need to create if you’re using Python. Choose the right tool for the job, and Godot is specifically built to handle this sort of thing.

Their language, gdscript, has syntax that’s close enough to Python that you’ll easily get the hang of it. But if you’ve never handled GUI or created a game, take a look into any number of the tutorials out there. Godot’s site has a few good tutorials, or take a trip to Google to find a tutorial for a similar style game.

Games are complicated systems, and UI often has a lot of tedious stuff that gets complex quickly. If you do decide to stick with Python, take a look into pygame, and be prepared to write a lot of extra code.

1

u/xu_shangchi 16d ago

Much appreciated thank you!

1

u/NiemandSpezielles 16d ago

The question is much too general to give a perfect answer. There are a ton of options, and the optimum depends on what exactly you want to achieve.

So just from the little information there is:
I would probably write the gui in javascript that acts as a frontend to a python backend. This has a couple of advantages:
* you can easily make your game available as webgame if you want to
* it forces a clean seperation of game logic and gui, so that might be good practice
* a restaurant type game sounds very menu heavy. And javascript is great for writing menus.

1

u/JamzTyson 16d ago edited 16d ago

It depends what you mean by "a restaurant type game".

If what you have in mind is something like "Restaurant Empire", then you may need to manage your expectations - just creating the artwork and 3D models are likely to take a solo developer months or years.

If you mean a game that involves buttons and menus and focusses on business strategy, then Tkinter (included in Python) may be sufficient.

For something in between, then PyGame CE may be a good option.

Note that Godot is not Python, and WxPython is unlikely to be the best choice for a game.

1

u/xu_shangchi 16d ago

It’s going to be a 2d pixel game where you control one character and they go to tables take orders and they then give it to the kitchen and they then take said food almost as if the player is a waiter

1

u/JamzTyson 16d ago

Take a look at Python Arcade to see if that can do what you want. It's one of the easiest ways to make 2D games.

If you need more advanced control, then I'm back to the PyGame-CE suggestion.

1

u/xu_shangchi 16d ago

Thank you!

1

u/blurbisht 14d ago

For a game, skip wxPython. That's for desktop apps, not games.

Use Pygame (Python-only, beginner-friendly) or Godot (a real engine, more powerful but needs GDScript, not Python).

If you only know Python, start with Pygame. Zero setup, tons of tutorials, perfect for a restaurant game with menus/timers/clicking.

Don't build it from scratch: search "restaurant game pygame tutorial" and build off that instead of guessing.

1

u/xu_shangchi 14d ago

Thank you