Closed gabrielflorit closed 5 years ago
The absolute easiest way is to give readers an <iframe />
embed tag that points to the game part of script-8 (on github.io). And I think that's probably not a lot of work. But it does mean they are not hosting the game on their pages.
Some more thoughts, in no particular order:
index.html
should contain all the code? i.e. you don't need a connection if you have the index.html
.If you're feeling adventurous, I'd start by experimenting with the <iframe />
route. Make it so the embed code has the game id, e.g. <iframe id=gameid />
. Then, in Iframe.js
, we'll have to find a way to make it fetch
the id if it's an iframe
attribute. After that you should be good to go.
Good points. I am concerned about the fact that APIs are still in flux. What happens if a post is written that depends on old APIs and embeds the current version of the game. Embedded games will fail in weird ways. pico-8's strategy seems to be export an entire copy of the engine so that the embedded game doesn't depend on future changes. This strikes me as much harder though...
Good point. This requires some further thinking.
Can you talk a little bit about how you were thinking of doing this? I would really like to embed the game into my blog but I can't really as things currently are. Maybe I could help push this forward?