var game = (function() {
  "use strict";
  
  var body          = document.getElementsByTagName("body");
  var viewport      = [];   //Contains the locations of currently viewable items
  var platforms     = {};
  var player        = {};

  function getJson(file){
    var request = new XMLHttpRequest();

    request.open("GET", "json/" + file + ".json", false);
    request.send();

    return JSON.parse(request.responseText);
  }


  var setViewport = function(x, y, width, height, value){
    try{
      for(var i = 0; i < width; i++){
        for(var j = 0; j < height; j++){
          viewport[x + i][y + j] = value;
        }
      }
    }catch(e){
      console.log(e);
    }
  }

  return {
    run: function(){

      for(var x = 0; x < VIEWPORT_WIDTH; x++){
        viewport[x] = [];
        for(var y = 0; y < VIEWPORT_HEIGHT; y++){
          viewport[x][y] = '';
        }
      }

      var gameboard = document.getElementById("gameboard").getContext("2d");

      var playerData = getJson("player");
      var level = getJson("level/1");
      
      gameboard.canvas.height = gameboard.canvas.clientHeight;
      gameboard.canvas.width = gameboard.canvas.clientWidth;

      //load level.
      //

      platforms = platform(level.platform);
      platforms.viewport = viewport;

      player = character(playerData, level.floor);
      player.viewport = viewport;
      player.bounce();
    },

    userInput: function(e){
      switch(e.which){
        case 37:  //left arrow
        case 65:  //a key
          player.left = true;
          break;
        case 39:  //right arrow
        case 68:  //d key
          player.right = true;
          break;
        case 32:
          player.jump = true;
          break;
        default:
          break;
      }
    },

    noUserInput: function(e){
      switch(e.which){
        case 37:  //left arrow
        case 65:  //a key
          player.left = false;
          break;
        case 39:  //right arrow
        case 68:  //d key
          player.right = false;
          break;
        case 32:
          player.jump = false;
          break;
        default:
          break;
      }
    }
  };
}());

window.addEventListener("keydown",  function(e) { game.userInput(e); }, false);
window.addEventListener("keyup",  function(e) { game.noUserInput(e); }, false);

@@ -201,18 +201,18 @@
 s     = 
-%7B%7D
+%5B%5D
 ;%0A  var 
@@ -432,263 +432,8 @@
  %7D%0A%0A
-%0A  var setViewport = function(x, y, width, height, value)%7B%0A    try%7B%0A      for(var i = 0; i %3C width; i++)%7B%0A        for(var j = 0; j %3C height; j++)%7B%0A          viewport%5Bx + i%5D%5By + j%5D = value;%0A        %7D%0A      %7D%0A    %7Dcatch(e)%7B%0A      console.log(e);%0A    %7D%0A  %7D%0A%0A
   re
@@ -796,15 +796,9 @@
 %22);%0A
-      
 %0A
+
     
@@ -958,83 +958,142 @@
     
-platforms = platform(level.platform);%0A      platforms.viewport = viewport;%0A
+for(var i = 0; level.platform%5Bi%5D !== undefined; i++)%7B%0A        platforms.push(platform(i, level.platform%5Bi%5D, viewport));%0A      %7D%0A      
 %0A   
@@ -1568,24 +1568,54 @@
 ak;%0A      %7D%0A
+      event.preventDefault();%0A
     %7D,%0A%0A    
@@ -1970,32 +1970,32 @@
      break;%0A
-
       %7D%0A
     %7D%0A  %7D;%0A%7D
@@ -1978,24 +1978,54 @@
 ak;%0A      %7D%0A
+      event.preventDefault();%0A
     %7D%0A  %7D;%0A%7D

Store each platform{} in an array