@@ -0,0 +1,2167 @@
+(function(window, Object) %7B%0A%0A  var diogenes = %7B%7D;%0A%0A  diogenes.Game = function(canvas, width, height, screen, items, characters, player) %7B%0A%0A    // Canvas context%0A    this.ctx = canvas.getContext('2d');%0A%0A    // Dimension%0A    this.width = width;%0A    this.height = height;%0A%0A    // Objects%0A    this.screen = screen;%0A    this.items = items;%0A    this.characters = characters;%0A    this.player = player;%0A%0A    this.draw = (function(ctx) %7B%0A%0A      var drawElement = function(elem) %7B%0A        elem.draw(ctx, elem.asset, elem.x, elem.y, elem.width, elem.height);%0A      %7D;%0A%0A      return function() %7B%0A        drawElement(this.screen);%0A        this.items.forEach(drawElement);%0A      %7D;%0A%0A    %7D(this.ctx));%0A%0A    this.run = function() %7B%0A      this.draw();%0A      window.requestAnimationFrame(this.run.bind(this));%0A    %7D;%0A%0A    canvas.addEventListener('click', function(e) %7B%0A      console.log(e.pageX, e.pageY);%0A      items.forEach(function(item) %7B%0A        item.isMouseOver(e.pageX, e.pageY, item.x, item.y, item.x+item.width, item.y+item.height);%0A      %7D);%0A    %7D);%0A%0A  %7D;%0A%0A  diogenes.DrawableEntity = %7B%0A    draw: function(ctx) %7B%0A      ctx.drawImage(this.asset, this.x, this.y, this.width, this.height);%0A    %7D%0A  %7D;%0A%0A  diogenes.InteractiveEntity = Object.create(diogenes.DrawableEntity);%0A%0A  diogenes.InteractiveEntity.isMouseOver = function(x, y) %7B%0A      if (x %3E= this.x && x %3C= this.x + this.width && y %3E= this.y && y %3C= this.y + this.height) %7B%0A        return true;%0A      %7D%0A%0A      return false;%0A  %7D;%0A%0A  diogenes.Screen = function(id, x, y, width, height, asset) %7B%0A    this.id = id;%0A    this.x = x;%0A    this.y = y;%0A    this.width = width;%0A    this.height = height;%0A    this.asset = asset;%0A  %7D;%0A%0A  diogenes.Screen.prototype = Object.create(diogenes.DrawableEntity);%0A%0A%0A  diogenes.Item = function(id, x, y, width, height, asset) %7B%0A    this.id = id;%0A    this.x = x;%0A    this.y = y;%0A    this.width = width;%0A    this.height = height;%0A    this.asset = asset;%0A  %7D;%0A%0A  diogenes.Item.prototype = Object.create(diogenes.InteractiveEntity);%0A%0A  diogenes.Character = function() %7B%7D;%0A%0A  diogenes.Player = function() %7B%7D;%0A%0A  // Make the diogenes object global%0A  window.diogenes = diogenes;%0A%0A%7D(window, Object));%0A

Implement some constructors and animation loop