Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adventurelib games to be built to run in the browser #11

Open
lordmauve opened this issue Feb 4, 2018 · 5 comments
Open

Allow adventurelib games to be built to run in the browser #11

lordmauve opened this issue Feb 4, 2018 · 5 comments

Comments

@lordmauve
Copy link
Owner

In order to distribute adventurelib games, it would be convenient to be able to build them into a single HTML file that can be hosted on a static webserver or e-mailed to friends.

The idea would be to use one of the several browser-based Python implementations to run the code or transform it to Javascript. While the compatibility of these implementations may not be perfect, I would expect that many adventurelib games are simple enough to run without issue.

@flexo made a start on this at Pycon UK - work is at iguanaonmystack/adventurelib@cd0d0db

@lordmauve
Copy link
Owner Author

@amigrave had some success doing this with Pyodide at the Europython 2018 sprints.

@KeyWeeUsr
Copy link
Contributor

Single HTML would do just by creating a convenient HTML template that validates through W3C validator. Re the JS, perhaps there is no need for that and the whole source might be just used as a Brython within <script> tags. :)

@lordmauve
Copy link
Owner Author

I have added the Brython branch with some code to explore running games in the browser. Brython seems to have come a long way; this is very workable now.

@lordmauve
Copy link
Owner Author

I think the next steps is to add a CLI tool that will pack Brython, the game scripts (noting that more than one is allowed), and the HTML framework into one HTML file. It will be a large HTML file but distributing one file is so much easier than many, especially for beginners.

Much of the Brython standard library will be useless so perhaps we could trim this.

@lordmauve
Copy link
Owner Author

A suggestion at PyCon UK was to also provide a browser based IDE for adventurelib games.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants