I am looking to create a simple online multiplayer game. Each player choose a number as their input and get a result based on simple calculations as their output. The code for the game itself is already created in VBA, but i am looking to make it online. Could i use Python for that, and do i need to create a website?
Asked
Active
Viewed 928 times
1
-
possibly duplicate: https://stackoverflow.com/questions/19140638/creating-a-2-player-game-in-python – Daweo Jan 16 '19 at 10:34
1 Answers
1
Online for public use or to share with someone specific (friend or someone else)?
If it is with a friend you could try rerouting traffic from your router to you PC with a specific port. Then create a simple website (with Flask for example, as it uses python) to make the game playable. Finally others could play the game by accessing your website through your public IP.

Marcos Pires
- 41
- 3
-
Thanks! The game would be for friends through invitation, yes. How could i reroute traffic from my router to my PC? Would that be after i created a website? – Aksel Skaar Jan 16 '19 at 11:03
-
You could create the website and have the backend of it running in your computer with your computer's local IP (that's the easy part). To reroute traffic you would have to access your router and create a rule that basically would say: all traffic that arrives to your public IP with a certain port (that you must define) is rerouted to your computer's local IP. (your computer would work as a server) – Marcos Pires Jan 16 '19 at 11:15
-
Thanks again! This solution would mean that only my PC with my unique IP would be required to be able to play the game? And that i would have to program any new router that controls the net where i am set up? If yes, is there any way to make it more generale? So that it would work from any PC with any Router? – Aksel Skaar Jan 16 '19 at 11:42
-
Unfortunately you would have to configure the router again for every new network you are connected yes. But if your friends are connected to the same network as you no rerouting would be needed, they would only need to access your local IP. (assuming the network you are connected allows it) – Marcos Pires Jan 16 '19 at 11:48
-
My friends would always be connected to the same network as me. At a school for instance. Does that mean that no rerouting would be required and that no unique PC is needed, following your recommendations. – Aksel Skaar Jan 16 '19 at 12:20
-
Schools usually block that kind of local traffic. What you could do is create a hotspot on your computer. This would need no rerouting and your friends would be able to play the game by connecting to your network and accessing your IP – Marcos Pires Jan 16 '19 at 14:18