Fixed double bug

This commit is contained in:
Ruben Müller 2014-12-06 17:42:16 +01:00
parent 945533b9ed
commit eecacde582

View file

@ -14,24 +14,10 @@ app = playground(
step: -> step: ->
mousedown: (event)->
@posToTile(event.x, event.y).click(event.button)
mousemove: (event)->
tile = @posToTile(event.x, event.y)
if tile != @currentHoveredTile
tile.moveIn()
@currentHoveredTile.moveOut()
@currentHoveredTile = tile
render: -> render: ->
@layer.clear "#00f" @layer.clear "#00f"
@game.render() @game.render()
posToTile: (x, y)->
pos = (Math.floor(y/8/5)*20) + Math.floor(x/8/5)
@game.map[pos]
layerIndexToName: (index)-> layerIndexToName: (index)->
resTypes = (k for own k of @game.resources) resTypes = (k for own k of @game.resources)
resTypes[index] resTypes[index]