I show how to create an online multiplayer game with python using sockets and basic python networking. This is really cool and works on your local network. I use pygame, sockets and threading to accomplish this.

To modify this to work on your computer go to CMD type ipconfig and find the ipv4 addrss of the machine that will be running the server. You must change the host attribute in the Network class to match this value.

Code:

**************************************************************
One-Time Donations:

Support the Channel:

Twitter:

Join my discord server:
**************************************************************

Please leave a LIKE and SUBSCRIBE for more content!

Tags:
– Tech With Tim
– Pygame
– Python Tutorials
– Python Networking
– Socket Programming Python
– Online game in python
– Python multiplayer game

42 COMMENTS

  1. To modify this to work on your computer go to CMD type ipconfig and find the ipv4 addrss of the machine that will be running the server. You must change the host attribute in the Network class to match this value.

  2. Love your videos man, thank you. Though I can't seem to make my game work online. I have a friend in another country and we want to play together but we can't seem to connect. Am I supposed to use my private IP address in Network and Server for it to work?

  3. video: * begins to play after a lot of loading & is now playing peacefully*
    Random YT ad: "I'm gonna ruin this man's entire career"

  4. hey can you make a step by step tutorial for this?? so that you can explain why you've used specific module or functions. and with characters instead of boxes if possible.. it'll be easy for you and quite help alot to us (beginners).. thanks in advance.. i love your tutorials bdw and you're very good in teaching..

  5. Hey! I just want to say thank you for this tutorial. I have a Distributed System project for my finals and your video helped me a lot on building that. Well, I might even say you just saved my ass back there lol. I just presented it to my professor today and he was impressed. It also makes me understand more about networking too. And it's all thanks to you. You just got another subscriber

  6. I can't seem to get it working with multiple computers. When I run the server on my laptop, the run works on the laptop, but not on my desktop. When I run the server on my desktop, the run also works on the desktop but then not on my laptop. I get the same error for both:
    ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

  7. Thank you so much for this video ! It's very clear and well explained. I'm really interested in making multiplayer games, I've already done some simplistic using "Twisted" (Python) and Flash, but I was looking for something easier to use, so your video helped me a lot 🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here