Speechbubble says more

This commit is contained in:
Ruben Müller 2014-12-07 17:31:30 +01:00
parent 9dcef3b43e
commit 9a6ef0c994
4 changed files with 8 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

View File

@ -75,14 +75,19 @@ app.game =
tile.tick() for tile in app.game.map tile.tick() for tile in app.game.map
createMiner: -> createMiner: ->
if @currentSelectedTile and !@currentSelectedTile.entity and @checkResource('stardust', 30, true) if @currentSelectedTile and !@currentSelectedTile.entity
@currentSelectedTile.entity = new Miner if @checkResource('stardust', 30, true)
@currentSelectedTile.entity = new Miner
else
@speechbubble.say 'nores'
createSilo: -> createSilo: ->
if @currentSelectedTile if @currentSelectedTile
if @checkPosition(@currentSelectedTile) if @checkPosition(@currentSelectedTile)
if @checkResource('stardust', 20, true) if @checkResource('stardust', 20, true)
@currentSelectedTile.entity = new Silo @currentSelectedTile.entity = new Silo
else
@speechbubble.say 'nores'
else else
@speechbubble.say 'toofar' @speechbubble.say 'toofar'

View File

@ -8,6 +8,7 @@ app.game.speechbubble =
switch text switch text
when 'help' then @sprite = [0, 0, 27, 13] when 'help' then @sprite = [0, 0, 27, 13]
when 'toofar' then @sprite = [0, 13, 90, 13] when 'toofar' then @sprite = [0, 13, 90, 13]
when 'nores' then @sprite = [0, 26, 90, 13]
@visible = true @visible = true
@timeout = window.setTimeout @hide, 1000 @timeout = window.setTimeout @hide, 1000