Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fast and Furious: JavaScript

Fast and Furious: JavaScript

A collection of tips and tricks relating to game development on the web.

The companion code base to the talk can be found here:

http://github.com/KrofDrakula/tomcat

Check out my other game, too:

http://github.com/KrofDrakula/squirts

Klemen Slavič

March 06, 2014
Tweet

More Decks by Klemen Slavič

Other Decks in Programming

Transcript

  1. • • • ′ = ⋅ ; ′ = ⋅

    • ′ = ⋅ ; h′ = ℎ⋅ •
  2. function Vec2(x, y) { this.x = x; this.y = y;

    } Vec2.prototype.add = function(x, y) { if (x instanceof Vec2) return this.add(x.x, x.y); return new Vec2(this.x + x, this.y + y); };
  3. function Vec2(x, y) { this.x = x; this.y = y;

    } Vec2.prototype.add = function(x, y) { if (x instanceof Vec2) return this.add(x.x, x.y); this.x += x; this.y += y; return this; };