Skip to content

Instantly share code, notes, and snippets.

View richtaur's full-sized avatar
👁️
valadria.com

Matt Hackett richtaur

👁️
valadria.com
View GitHub Profile
viewDefinitions = {
"title": {
properties: {
backgroundColor: "black",
width: 640,
height: 480
},
children: {
"playButton": {
viewData = {
classes: {
"monster": {
image: "monster.png",
width: 64,
height: 64
}
}
};
@richtaur
richtaur / flickering_hearts_polish.js
Created March 14, 2012 05:53
Part of a polish tutorial
// Have the heart container "pop" in
polish.popIn(this, bind(this, function () {
// Wait a moment, then start to flicker away… then disappear
var numFlashes = 20;
this.numFlashes = 1;
// Wait 1 second
this.delayTween(1000);
// Add flashes to the queue
@richtaur
richtaur / transform_scaling.js
Created March 3, 2012 05:59
Transform Scaling in Canvas/JavaScript
if (client.isIOS) {
logger.info("Using 3D scaling");
var transform = "scale3d(" + scale + ", " + scale + ", 1)";
} else {
var transform = "scale(" + scale + ")";
}
canvas.style.webkitTransformOrigin = "0 0";
canvas.style.webkitTransform = transform;
You have connected
2:38
Geoff connected
2:59
You have connected
3:08
Geoff went idle
3:25
You have connected
4:04
@richtaur
richtaur / race-car.html
Created January 1, 2012 01:08
Racing simulation sent in by one of the listeners of our HTML5 game dev podcast
<!DOCTYPE html>
<html>
<head>
<title>Car Racer</title>
<meta charset="utf-8">
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
@richtaur
richtaur / object_literal.php
Created December 16, 2011 01:40
Object literals in PHP (sort of)
$foo = (object) array(
'bar' => 'bar'
);
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (function () {
return window.webkitRequestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.oRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function (callback, element) {
setTimeout(callback, 1000 / 60);
};
}());
@richtaur
richtaur / vg_industry_terms.md
Created October 15, 2011 01:48
Video Game Industry Terms

Video Game Industry Terms

Note: this is a modified version of a list by Kain Shin.

  • 80/20 Rule: 80 percent of the game comes from 20 percent of the work. The remaining 80 percent of the work goes into polishing that last 20 percent of the game.
  • 90/10 Rule: 90 percent of processor execution time is taken up by 10 percent of the code.
  • Adhocracy: Organization in which tasks are done by the people who realize they need to be done and/or are able to do them best. (See also: Pirate Ship.)
  • Aggro-nerd: Hyper-critical, combative, argumentative developer.
  • Alien Queen: A nasty bug which spawns countless other bugs as defenses, making it extremely hard to find... and when you do finally find it, it suddenly becomes a real fight. (Named after the queen alien from the Alien series.)
  • Alt-Tab: People with a reputation for not spending their time efficiently at work.
var sound = new Sound("/path/to/file.extension");
var sound = new Sound({
src: "/path/to/file.extension",
currentTime: 10,
onload: function () {
console.log("loaded!");
}
});