Python Online Game Tutorial #4 – Connecting Multiple Clients
This python multiplayer game tutorial covers how to connect multiple clients to your server using sockets and networking in python. The graphics that are used for this program are implemented with pygame.
Source Code:
⭐ Kite is a free AI-powered coding assistant for Python that will help you code smarter and faster. Integrates with Atom, PyCharm, VS Code, Sublime, Vim, and Spyder. I’ve been using Kite for 6 months and I love it!
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
📸 Instagram:
🌎 Website
📱 Twitter:
⭐ Discord:
📝 LinkedIn:
📂 GitHub:
🔊 Podcast:
💵 One-Time Donations:
💰 Patreon:
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
– Tech With Tim
– Online Multiplayer game tutorial
– Python multiplayer game tutorial
– Multiplayer game tutorial
– Online game tutorial
– Python Tutorials
Nguồn: https://macdinhchi71.com
Xem thêm bài viết khác: https://macdinhchi71.com/game/
Xem thêm Bài Viết:
- 789 Club – Trò chơi đánh bài đổi thưởng mang đậm tác phong của một casino đẳng cấp số 1
- Cách thức nạp game bắn cá iCá đơn giản, nhanh chóng hiện nay
- Cách chơi game bài đổi thưởng online đơn giản hiệu quả cao
- Cổng game đáng tin bậc nhất ở Việt Nam – B52 Club! CHƠI LÀ THẮNG.
- Xóc đĩa 3d Dabet – cả thế giới trong chiếc điện thoại
Comments (32)
Ben Wall
09 Jun 2020To anyone who can't run the client in parallel , Tim missed a step where you need to Edit Configuration in the top right for client, and in the top right of that window, tick the box for allowing parallel run.
Nitesh Kumar
09 Jun 2020Can you tell me what's the problem. My second client is not running
Nitesh Kumar
09 Jun 2020For second time my client not able to run help please
L A
09 Jun 2020very useful video, thank you! just one question:
If the p2Pos equals the position of player 1, what would you do if you wanted to add a third client? I tried making it equal the position of player 2 but that did not work.
Sarvesh Sundaram
09 Jun 2020pycharm keeps telling me that s.listen(2) is an invalid argument. can someone help me?
kumar s
09 Jun 2020For people with Nonetype has no attribute split error , change the name of argument in readpos from str to something else.
Tom Murphy
09 Jun 2020hey, really nice work on these. very helpful
ksadra
09 Jun 2020if server is on my laptop my pc can connect, but if server is on my pc i cant connect with my laptop (no ERRORs it just says nothing)
Olle
09 Jun 2020Everyone that can't make a second client, just make a configuration and call it client2 and give it the same script path as the normal client. Then it should work.
Eman
09 Jun 2020I cant open 2 clients. why???
Bella Liu
09 Jun 2020This is awesome thank you so much for the effort!!!!!
Nick Moreno
09 Jun 2020Hey, how would I add a third player to this? Great series and thank you.
Random Guy
09 Jun 2020why turn it into a string?
Kevin Aaron
09 Jun 2020It DOESN'T WORK
don't waste your time
Even with the code from the website…
DeathDragon7050
09 Jun 2020literally copy and pasted your source code and can't get the client to work because of the fain of the read_pos function and the fact that you can't fucking run 2 clients at once
Vaishali Sharda
09 Jun 2020Can you help me. I keep getting a error. Traceback (most recent call last):
File "C:UsersVishalDesktopCodingPython foldercreative pythonserver.py", line 15, in <module>
s.listen(2)
OSError: [WinError 10022] An invalid argument was supplied
kent daniel
09 Jun 2020How can i run both clients in parallel in pycharm.. Really stuck here
Alexander Trists
09 Jun 2020@Tech With Tim hey your videos are awesome i liked n subscribed but im really stuck at this video ( i dont wanan move on first) because i can connect both clients UNLESS i move first. my problem is that no matter what, whenever i move i get a 10053 error thrown consistently
Hyperion Network
09 Jun 2020Lets get Tim's subscriber count to 30K. Reply if your with me
Blood Seeker
09 Jun 2020Hi Tim, & other kind souls who are attempting to code this game,
I was following through your pygame tutorial videos and got stuck at 1 portion .
This is the video tutorial i was following through : Python Online Game Tutorial #4 – Connecting Multiple Clients
This is the error i was thrown when i tried running the server.py.
Traceback (most recent call last):
File "Python/PythonProj3/server.py", line 21, in <module>
s.listen(2)
OSError: [WinError 10022] An invalid argument was supplied
Process finished with exit code 1
The line of code the error was hit was –> s.listen(2)
This is the portion you mentioned we had to put 2 as there will be 2 people connection to the server. Any idea what might be causing the error for me? I tried to copy your source code from your page and i got the same error :/
Would you be able to tell me how i can troubleshoot this…
Thanks in advance for your help!!
Rat iemand
09 Jun 2020Hi Tim! I have a question:
If I want to make an online game and send it to random people so they can play against each other, does the server then needs to be running on my computer or on one of theirs?
sorry if you don't understand this question or if you already awnsered it in one of your videos or something but I can't find any awnser so I decided to ask you.
Thanks!
Oliver X
09 Jun 2020I think it's better to mention that when closing the server, we should press control + c to close the threads. Otherwise, the next time you run, it will have weird bugs.
Madhu prasad
09 Jun 2020❤️❤️❤️❤️❤️
Shreevathsa GP
09 Jun 2020For some reason i cannot run client twice, I only have the option to rerun it and that does not work.
son nguyen
09 Jun 2020there is an error :
str = str.split(",")
AttributeError: 'NoneType' object has no attribute 'split'
is there special package to split 'nonetype'?
A Quo Co.
09 Jun 2020I'm having both of the same problems as others are having with the "listen" error ("[WinError 10022] An invalid argument was supplied") and the 'NoneType' object has no attribute 'split' even using the original code from his website and correct IP. Anyone have a solution?
Doctor Dark Crystals
09 Jun 2020I can't run two clients i tried applying (allow parallel run) but it's not working
and there's an error saying:
str = str.split(',')
AttributeError: 'NoneType' object has no attribute 'split'
Doctor Dark Crystals
09 Jun 2020damn, this is the best series up till now
Davide Ettori
09 Jun 2020Love this series but how can i run 2 client at the same time using the python IDLE??
Now if i run the second client, the first one get closed
Thank to everyone who help me
Shin Storm
09 Jun 2020Great vids looking forward to more. I was just going through some older vids from late last year,
what ever happened to the rest of Intermediate Python Tutorial you stopped at 8. I had forgotten all about that. Do you plan on finishing that up. Just wondering
WitherFallGaming 8
09 Jun 2020this is a great tutorial my server works but a few glitches in code
WitherFallGaming 8
09 Jun 2020my code isnt working 🙁 i keep getting a error saying that "s.listen" is the cause of the error