Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

Embedding Games

Every published or public game on Play My Code can be embedded on your own website or blog. Click the "Embed" button on the bottom bar of the game you would like to embed, and copy the code that pops up. Paste it where you would like the game to appear, and it will automatically be loaded whenever that page is visited.

There are a few other tricks and options which can be taken advantage of when embedding games:

Resizing

To change the size of an embedded game simply adjust the iframe's 'width' and 'height' values in the embed code.

Games automatically resize to fill the container they're within, and to append black borders if the proportions do not fit.

Full Screen Mode

In the game embed code, a link to a full screen version of the game can be obtained by copying the URL from the iFrame's 'src' value. Your link should look something like this:

http://www.playmycode.com/play/embed/Joe/raycaster

Visit this link with your browser for a full screen version of that game. You can of course share this, or link to the full screen version from your website.

auto_play Flag

You can make a game play automatically when the page loads- useful for certain situations. Find the iFrame's 'src' value in the embed code, and append '?auto_play=true' to the end of it. See an example below of how your 'src' value should look if you do this:

src="http://www.playmycode.com/play/embed/Joe/raycaster?auto_play=true"

run_fullscreen Flag

You can set the game, so when a user clicks play, it opens the game in a fullscreen tab. Like with Auto Play, this is achieved by adding a flag onto the 'src' value. In this case it is 'run_fullscreen'. For example:

src="http://www.playmycode.com/play/embed/Joe/raycaster?run_fullscreen=true"

Due to technical limitations, this has to be within a new tab.