diff --git a/public/images/info.png b/public/images/info.png new file mode 100644 index 0000000..274a2a6 Binary files /dev/null and b/public/images/info.png differ diff --git a/src/app.coffee b/src/app.coffee index f90657b..c19b66f 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -5,7 +5,7 @@ app = playground( smoothing: false, create: -> - @loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "speechbubbles", "deadtiles", "layerdetails", "entitydetails", "buildinfo", "cursor" + @loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "speechbubbles", "deadtiles", "layerdetails", "entitydetails", "buildinfo", "cursor", "info" @currentHoveredTile = new Tile ready: -> diff --git a/src/game.coffee b/src/game.coffee index 747907c..33fe125 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -57,11 +57,14 @@ app.game = if @isMouseInView event.x/8, event.y/8 switch event.button when 'left' - tile.click(event.button) + if event.x > 143 and event.x < 151 and event.y > 95 and event.y < 106 + app.game.hud.showBuildInfo() + else + tile.click(event.button) - @currentSelectedTile.deselect() if @currentSelectedTile - tile.select() - @currentSelectedTile = tile + @currentSelectedTile.deselect() if @currentSelectedTile + tile.select() + @currentSelectedTile = tile when 'right' @currentSelectedTile.deselect() if @currentSelectedTile @currentSelectedTile = null diff --git a/src/hud.coffee b/src/hud.coffee index 7b10a23..e295940 100644 --- a/src/hud.coffee +++ b/src/hud.coffee @@ -18,6 +18,8 @@ app.game.hud = panelusage = 'resources' app.layer.drawImage app.images.hud, 0, 11*8 + app.layer.drawImage app.images.info, 143, 95 + # cursor # app.layer.drawImage app.images.cursor, app.game.mouseX, app.game.mouseY