Not sure how to word it, but essentially:
Would it be possible to embed a game into HTML5 and have it communicate/send data to a webpage?
EG: I have a board game embedded into a webpage, and whenever a player wins/loses, a signal is sent to the webpage/data handler and the player’s ratings are updated. (Think lichess, the game is coded in Scala I believe, but the webpage handles player information)
You have multiple options:
- Use http.request(). You can send any kind of HTTP request. GET, POST etc. Very few limitations. Good for turn based games or other interaction that doesn’t happen super often.
- Use a socket connection. This will convert into a WebSocket. Good for realtime games.
- Use html5.run(). Run arbitrary code on the same page as your hosted game.
- Use a native extension. This give you total freedom to integrate with any Javascript SDK or C/C++ library. Basically no limitations at all.
3 Likes