Skip to content

Instantly share code, notes, and snippets.

var d = new Date();
var s = d.toTimeString();
var i = Math.random();
s = i.toString();
public class Class1<T>
{
T _val;
public Class1(T val)
{
_val = val;
}
}
Class1 = (function() {
function Class1(val) {
this._val = val;
}
var p = Class1.prototype;
p._val = null;
return Class1;
})();
public virtual Menu[] buildMenus()
{
    return new[] 
{
new Menu("Display", "display", 
new Setting[]
{
new FullScreenSetting(),
new ResolutionSetting(),
new StretchToWindowSetting()
<div id="gameWrapper">
</div>
<script type="text/javascript">
    window.onload = function () {
    var demo = new Ventajou.Demos.SmilingFaceGame(document.getElementById('gameWrapper'));
    };
</script>
<div id="gameWrapper">
</div>
<script type="text/javascript">
window.onload = function () {
var demo = new Ventajou.Demos.SmilingFaceGame(document.getElementById('gameWrapper'));
};
</script>
<!DOCTYPE html>
<!--
DOM sprite demo
by Christer Kaitila
http://mcfunkypants.com
http://twitter.com/McFunkypants
http://google.com/+ChristerKaitila
Created for Build New Games (c) 2012 by Bocoup
http://www.buildnewgames.com
<body>
<div id='header'>
HTML5 dom sprite rendering benchmark -
Not using canvas: each sprite is a DIV -
by <a target='_parent' href='http://twitter.com/McFunkypants'>McFunkypants</a> -
Icons by Ails (cc)</a></div>
<div id='viewport'><div id='background'><div id='level'></div></div></div>
<script type='text/javascript'>
// grab the DOM elements we want to manipulate
var viewport = document.getElementById('viewport');
var level = document.getElementById('level');
var background = document.getElementById('background');
var stats = document.getElementById('stats');
var playbutton = document.getElementById('playbutton');
// size of the the viewport and the larger level within
var viewportW = viewport.clientWidth;
var viewportH = viewport.clientHeight;
var levelW = level.clientWidth;
var levelH = level.clientHeight;
// how fast do we scroll the level tiles
var levelSpeed = -1;
// the current scroll location of the level
var levelx = 0;