Fixed double bug
This commit is contained in:
parent
945533b9ed
commit
eecacde582
1 changed files with 0 additions and 14 deletions
|
@ -14,24 +14,10 @@ app = playground(
|
|||
|
||||
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: ->
|
||||
@layer.clear "#00f"
|
||||
@game.render()
|
||||
|
||||
posToTile: (x, y)->
|
||||
pos = (Math.floor(y/8/5)*20) + Math.floor(x/8/5)
|
||||
@game.map[pos]
|
||||
|
||||
layerIndexToName: (index)->
|
||||
resTypes = (k for own k of @game.resources)
|
||||
resTypes[index]
|
||||
|
|
Loading…
Reference in a new issue