1

With python I would like to create a simple web-based game to which players can connect and which has some simple graphics with elements to click on, pop-ups might open with tables a user can enter a value and/or click on things. I started developing something like this with javascript and three.js with a flask python backend, but developing the frontend stuff (clickable graphics, pop-up with clickable table elements) are horrendously complicated for me.

The basic setup of this game is a multiplayer game (<5 players) where each player sees the same map which is a map of countries and cities a user can zoom into and scroll. The user can then click on cities to get information of the city in a popup/overlay/whatever, the individual user can also get a popup/overlay to select like from a list of airplanes (table showing image and data of airplanes), can input data, etc.

Is there any other python framework out there that can be used to create the same setup? It does not have to be very performant or for hundreds of players, but I would prefer more python, less hassle.

1
  • 1
    It would help if you specified what kind of game you're working on as there are so many possibilities and libraries that could help with each. Is it more like let's say wordle or factle, so very simple UI clicking one, or something more complex than that? Is it more dynamic or static? Is it multiplayer or single?
    – Destroy666
    Mar 25, 2023 at 21:08

1 Answer 1

0

Your best bets if you really insist on Python for your frontend (uncommon choice) seem to be Brython, which transpiles Python to JavaScript (and comes with a small runtime to make it work), or pyodide, which consists of the actual CPython bytecode VM ported to WebAssembly (so it might be a bit bloated). Here is a useful reflection on the pros/cons of either approach and a recommendation of a third option (Skulpt).

Some older transpilers are Transcrypt and pscript, but last time I checked, these weren't actively maintained.

But it probably makes sense to get better at JavaScript anyway, given how ubiquitous it is and that it is the "natural choice" for web frontend. Another popular alternative which might be a bit more comfortable to use (and is similarly ubiquitous) is TypeScript, which transpiles to JavaScript and is probably more robust and established than any of the Python options I mentioned above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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