Ask coding questions

← Back to all posts
Online Multiplayer Game in Repl using Pygame and Flask
Kosmic (2)

I am wanting to make an online .io-style game using Python. I will be writing it on repl. I have been looking for a tutorial for a game that uses both Pygame and Flask for a game like this, but have not been able to find anything.
I am somewhat experienced in Pygame, but am completely new to Flask and server-client programs.

Can someone please point me to a good tutorial for this?

Answered by realTronsi (923) [earned 5 cycles]
View Answer
Comments
hotnewtop
realTronsi (923)

@Kosmic I found this tutorial, it uses pygame for the frontend and it teaches you how to make it from start to finish:

https://www.youtube.com/watch?v=McoDjOCb2Zo

Kosmic (2)

@realTronsi I looked at that one already, and it doesn't show how to send it out to the world and host it online.

realTronsi (923)

@Kosmic bruh hosting is a completely different storing. You will need to buy a hosting package (or use repl), and also buy a domain from domain providers such as namecheap.com or get a free domain at freenom.com, and link it up so that it is hosted online

ConstantineWes1 (2)

Host a free server with pythonanywhere.com
i made this website in a few days using flask: http://cwesterink23.pythonanywhere.com

ConstantineWes1 (2)

I am not sure how integrate pygame into the website but here is a link: https://www.pythonanywhere.com
On this website you can get a free 'pythonanywhere.com' domain name and upload python and html files using flask as your web framework.

I made this website with flask in a couple days: http://cwesterink23.pythonanywhere.com/
(ik its bad, i am new to flask and html)

Coder100 (18882)

well, you could do this in flask only!

https://codeburst.io/building-your-first-chat-application-using-flask-in-7-minutes-f98de4adfa5d

Here's a little chat application, but it will be similar with game-making too!

Kosmic (2)

@RYANTADIPARTHI it looks like nobody has responded to that question yet.

RYANTADIPARTHI (6019)

@Kosmic well, other than that. I don't know any tutorials using pygame AND flaks. But if you want JUST flask, I've got millions.

Kosmic (2)

@RYANTADIPARTHI I just want to use pygame because it is the only graphics-engine for python that I know of. If you know of a different one that would be equally good/better, that would be fine

RYANTADIPARTHI (6019)

@Kosmic ok, so there's something called turtle, just like pygame, but you can make games, and designs, and animations and all.

Here are a few links:

https://realpython.com/beginners-guide-python-turtle/
https://www.geeksforgeeks.org/turtle-programming-python/

But if you want just pygame, then I'll give a few tutorials for that too.

Kosmic (2)

@RYANTADIPARTHI Awesome! Do you have any tutorials that use both turtle and flask?

I honestly just need tutorials to make a .io-styled game using flask and a graphics engine

RYANTADIPARTHI (6019)

@Kosmic sure, i'll give you some. But if you want can you mark my answer? Thanks!

RYANTADIPARTHI (6019)

@Kosmic Also one more thing is, i don't think you can use flask to make a game. Cause that's all about making websites. But you can make the game using turtle.

Kosmic (2)

@RYANTADIPARTHI I am responding to other answers

RYANTADIPARTHI (6019)

@Kosmic oh, ok, have you see mine?