Ask coding questions

← Back to all posts
Adding my pygame game to a website?
h
JamesB67

Hi,

We are making a basic chess engine using pygame, currently you can just move the pieces (run ChessMain.py to see)

I'd like to host the engine on a webpage with a .repl url. This would allow someone to go to the url and move some of the pieces around.

I'm not sure where to start, do I need to start using REST API's and Flask? Or is there a simpler way to integrate it using replit? Thanks in advance for your help/patience!

Voters
ichbindede
Comments
hotnewtop
Highwayman

If you check the replit docs, you'll find that there is a sort-of-api built specifically for accessing the visual/audial output of a Repl. https://docs.replit.com/hosting/streaming-native-graphics-vnc

I'm guessing you could simply embed an iframe to the noVNC client or something like that.

JamesB67

@Highwayman Thanks for that will check it out and hopefully get it running soon!

Highwayman

your welcome :) @JamesB67

JamesB67

@Highwayman Getting somewhere! This is what I've got at the moment. Is there a way to get rid of the header and footer and just show the game itself?

Highwayman

maybe.... It's just showing it as ubuntu would normally show a window, so If you look that up you should find some way around it, maybe. @JamesB67

Highwayman

okay so I found this, on hiding the "title bar", and this on maximizing a window. @JamesB67

JamesB67

Cheers will have a look! @Highwayman

Highwayman

I works? yay! @JamesB67