/jsil.org/demos/Tetris/Tetris.html
http://github.com/kevingadd/JSIL · HTML · 74 lines · 64 code · 10 blank · 0 comment · 0 complexity · 04b1bda6ce34ce206b4ffa28ecd93b7a MD5 · raw file
- <!DOCTYPE html>
- <html>
- <head>
- <title>XNA4 Tetris Game</title>
- <link rel="stylesheet" href="../Common/browser.css">
- <link rel="stylesheet" href="tetris.css">
-
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- </head>
- <body onload="onLoad()">
- <script type="text/javascript">
- var jsilConfig = {
- printStackTrace: false,
- webgl2d: true,
- xna: 4,
- manifests: [
- "tetris.exe",
- "Content/tetrisContent.contentproj"
- ],
-
- showProgressBar: true,
- showStats: true,
- scriptRoot: "",
- libraryRoot: "../Libraries/",
- fileRoot: "",
- contentRoot: "Content/"
- };
- </script>
- <script src="../Libraries/JSIL.js" type="text/javascript"></script>
-
- <canvas id="canvas" width="1024" height="768">
- </canvas><br>
- <div id="welcomeMessage">
- <p align="center"><a href="http://jsil.org/"><img src="http://jsil.org/images/jsil_48px.png" alt="JSIL logo" border="0"></a></p>
- <p>This demo is a simple XNA 4.0 game, compiled from C# to JavaScript using <A href="http://jsil.org/">JSIL, my open-source C# to JavaScript compiler</a>. It should run in any browser that supports HTML5 and a modern version of JavaScript, no plugins required.</p>
- <p>You can get the source code to this demo from <a href="https://github.com/ttocs7/tetris">the author's page on GitHub</a>.</p>
- <p align="center">To begin playing, click the <b>Load Game</b> button below.</p>
- </div>
- <button id="loadButton">Load Game</button>
- <div id="log"><center><i>Left/right arrows to move piece. Up to rotate piece. Space to drop piece.</i></center><br></div>
-
- <script type="text/javascript">
-
- var assetsToLoad = [
- ];
-
- function runMain () {
- try {
- document.getElementById("welcomeMessage").setAttribute("style", "display: none");
- } catch (ex) {
- }
- // We can't invoke Main() since it disposes the Game immediately, breaking everything.
- var asm = JSIL.GetAssembly("tetris, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
- var game = new asm.tetris.Game1();
- game.Run();
- };
- </script>
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-6375004-2']);
- _gaq.push(['_setDomainName', '.luminance.org']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- </body>
- </html>