diff --git a/public/images/speechbubbles.png b/public/images/speechbubbles.png index d2edc5a..aecfe10 100644 Binary files a/public/images/speechbubbles.png and b/public/images/speechbubbles.png differ diff --git a/public/images/speechbubbles.psd b/public/images/speechbubbles.psd new file mode 100644 index 0000000..bc7b947 Binary files /dev/null and b/public/images/speechbubbles.psd differ diff --git a/src/game.coffee b/src/game.coffee index af98713..f482e2e 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -75,14 +75,19 @@ app.game = tile.tick() for tile in app.game.map createMiner: -> - if @currentSelectedTile and !@currentSelectedTile.entity and @checkResource('stardust', 30, true) - @currentSelectedTile.entity = new Miner + if @currentSelectedTile and !@currentSelectedTile.entity + if @checkResource('stardust', 30, true) + @currentSelectedTile.entity = new Miner + else + @speechbubble.say 'nores' createSilo: -> if @currentSelectedTile if @checkPosition(@currentSelectedTile) if @checkResource('stardust', 20, true) @currentSelectedTile.entity = new Silo + else + @speechbubble.say 'nores' else @speechbubble.say 'toofar' diff --git a/src/speechbubble.coffee b/src/speechbubble.coffee index c002d4a..e48ca47 100644 --- a/src/speechbubble.coffee +++ b/src/speechbubble.coffee @@ -8,6 +8,7 @@ app.game.speechbubble = switch text when 'help' then @sprite = [0, 0, 27, 13] when 'toofar' then @sprite = [0, 13, 90, 13] + when 'nores' then @sprite = [0, 26, 90, 13] @visible = true @timeout = window.setTimeout @hide, 1000