I ask for embed in my website, not for hosting
It depends on the structure of your website.
If it is a CMS or some sort of software of the like you should check its documentation and see how to add html pages.
When you export your C2 project, it creates:
- index.html
- c2runtime.js
- folder images (if you chose so)
- folder medias (if you chose so)
Anyway, all the files should be copied to your website (put them all in a specific folder. "Spielen" for example).
index.html acts as an entry point to the game. either make a link from your site to this page or modify some of your pages so that:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="c2runtime.js"></script>
<script type="text/javascript">
// Start the Construct 2 project running on window load.
jQuery(document).ready(function ()
{
// Create new runtime based on the preview canvas element
var project = new cr.runtime(document.getElementById("c2canvas"));
// Load and start running
project.load();
project.go();
});
</script>
appears in the header (between <head></head>).
In the <body></body> part of your page add:
<canvas id="c2canvas" width="X" height="Y" oncontextmenu="return false;">
where X and Y are the width and height of your application.
This canvas will be the "body" of your game, the frame in which it will be displayed.