diff options
-rw-r--r-- | src/app.coffee | 2 | ||||
-rw-r--r-- | src/view/MapView.coffee | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/app.coffee b/src/app.coffee index 630fcfd..6c64c5a 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -14,7 +14,7 @@ window.onload = -> xhr = new XMLHttpRequest() xhr.onload = -> mapDef = new Map(JSON.parse this.responseText) - mapView = new MapView mapDef, -> + mapView = new MapView mapDef xhr.open 'GET', 'resources/map/test.json', true xhr.send() diff --git a/src/view/MapView.coffee b/src/view/MapView.coffee index 8cb7404..cafc0aa 100644 --- a/src/view/MapView.coffee +++ b/src/view/MapView.coffee @@ -24,7 +24,7 @@ loadTiles = (tileDef) -> class MapView - constructor: (@map, ready) -> + constructor: (@map) -> @redrawPending = false @canvas = document.createElement 'canvas' @@ -36,10 +36,10 @@ class MapView window.addEventListener 'resize', @setSize @setSize() - loadTiles(@map.tiles).then (tiles) => + @ready = loadTiles(@map.tiles).then (tiles) => @tiles = tiles @redraw() - ready() + return drawTile: (x, y, tile) => return unless tile |