diff --git a/src/entities/tile.coffee b/src/entities/tile.coffee index 0ae278c..753f7b2 100644 --- a/src/entities/tile.coffee +++ b/src/entities/tile.coffee @@ -31,7 +31,7 @@ class Tile extends BaseEntity @currentMiner = null if @currentMiner tick: -> - @currentMiner.tick @ + @currentMiner.tick @ if @currentMiner moveIn: -> @isActive = true @@ -52,10 +52,6 @@ class Tile extends BaseEntity detachMiner: -> @currentMiner = null - gameTick: -> - if @currentMiner - @layers[@currentLayer].collect() - render: (x, y)-> tileLayer = @layers[@currentLayer] app.layer.drawRegion app.images.layers, tileLayer.sprite, x*8, y*8 diff --git a/src/game.coffee b/src/game.coffee index f9029b4..d273165 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -7,7 +7,7 @@ app.game = @currentSelectedTile = new Tile # Start the game tick - window.setInterval(@gameTick, 1000) + window.setInterval(@tick, 1000) render: -> for tile, i in @map @@ -44,8 +44,8 @@ app.game = @currentSelectedTile.deselect() if @currentSelectedTile @currentSelectedTile = null - gameTick: -> - tile.gameTick() for tile in @map + tick: => + tile.tick() for tile in app.game.map createMiner: -> if @currentSelectedTile and @checkRessources 'lubinit', 30, true