This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var d = new Date(); | |
var s = d.toTimeString(); | |
var i = Math.random(); | |
s = i.toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Class1<T> | |
{ | |
T _val; | |
public Class1(T val) | |
{ | |
_val = val; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class1 = (function() { | |
function Class1(val) { | |
this._val = val; | |
} | |
var p = Class1.prototype; | |
p._val = null; | |
return Class1; | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual Menu[] buildMenus() | |
{ | |
return new[] | |
{ | |
new Menu("Display", "display", | |
new Setting[] | |
{ | |
new FullScreenSetting(), | |
new ResolutionSetting(), | |
new StretchToWindowSetting() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="gameWrapper"> | |
</div> | |
<script type="text/javascript"> | |
window.onload = function () { | |
var demo = new Ventajou.Demos.SmilingFaceGame(document.getElementById('gameWrapper')); | |
}; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="gameWrapper"> | |
</div> | |
<script type="text/javascript"> | |
window.onload = function () { | |
var demo = new Ventajou.Demos.SmilingFaceGame(document.getElementById('gameWrapper')); | |
}; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |