GithubHelp home page GithubHelp logo

alexbarry / alexgames Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 0.0 10.03 MB

Simple Lua games available on web and more

Home Page: https://alexbarry.github.io/AlexGames/

License: Other

CMake 1.47% Shell 0.30% Batchfile 0.01% Java 5.88% C++ 8.84% Kotlin 0.57% C 9.41% Python 2.06% CSS 0.42% HTML 7.69% JavaScript 3.67% Lua 59.54% Dockerfile 0.13%
android board-game game lua wasm web webassembly websocket wxwidgets

alexgames's Introduction

AlexGames

A collection of simple Lua games, and a web engine for playing them including an English dictionary (for word puzzles), websocket multiplayer, state sharing via URL, and auto saving with undo/redo. You can also upload your own games and play in the public web version.

Try the web version here: https://alexbarry.github.io/AlexGames

Get it on F-Droid

How to build

Using docker

TL;DR: you can simply run sudo docker-compose up, then navigate to http://localhost:1234 . This hosts an HTML server on port 1234, and a websocket server on port 55433. But if you want to host it on a public server, you should build the static HTML separately, copy that to your HTML server content path, and run the websocket server separately (see below).

Build and host static HTML/JS/WASM

This commands build a docker image containing an HTTP server and the AlexGames static HTML, and it also outputs it to build/wasm/out/http_out:

sudo docker build -t alexgames_http_server \
	-f docker/http_server/Dockerfile \
	--target=export_output  \
	--output=build/wasm/out/http_out  \
	.
sudo chown -R "${USER}" build/wasm/out

For development purposes, you can host a simple HTTP server like this, on port 1234:

sudo docker run -p 1234:80 alexgames_http_server

Alternatively, copy build/wasm/out/http_out/* to your HTTP server path.

Build and host the websocket server

For development purposes, from a separate terminal, run this command to host the websocket server:

sudo docker build -t alexgames_ws_server -f docker/ws_server/Dockerfile .
sudo docker run -p 55433:55433 -it alexgames_ws_server

But for hosting on a public server, assuming you are using SSL (HTTPS), you will need to pass your SSL certs to the websocket server:

sudo docker run -p 55433:55433 -it alexgames_ws_server \
	--use_ssl \
	--ssl_fullchain /path/to/your_fullchain.pem \
	--ssl_privkey /path/to/your_privkey.pem

Try your server

If you ran the command to host the static HTML on port 1234, then simply navigate to http://localhost:1234.

If you copied it to your existing HTTP server, then you should be able to open it now.

How to build manually

See BUILD.md. I find this much more convenient for incremental builds.

Contact

alexgames's People

Contributors

alexbarry avatar poussinou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.