Show selected entities in HUD

This commit is contained in:
Ruben Müller 2014-12-07 13:32:10 +01:00
parent 0dc491909a
commit 3f8532a830
2 changed files with 7 additions and 3 deletions

View file

@ -10,4 +10,4 @@ Title: Entire game on one screen
** Spielstart in irgend einer weise ... (grafik)
** Hint für shortcuts anzeigen :ruben:
** Preise für entities :ruben:
** Mauszeiger fixen :ruben:
** Silos: Farben je nach Kapazität einfärben

View file

@ -14,8 +14,12 @@ app.game.hud =
render: ->
app.layer.drawImage app.images.hud, 0, 11*8
if app.game.currentSelectedTile != null
app.layer.drawRegion app.images.layers, app.game.currentSelectedTile.getCurrentLayer().sprite, 15, 100
currentSelectedTile = app.game.currentSelectedTile
if currentSelectedTile != null
app.layer.drawRegion app.images.layers, currentSelectedTile.getCurrentLayer().sprite, 15, 100
if currentSelectedTile.entity
app.layer.drawRegion app.images.entities, currentSelectedTile.entity.sprite(), 15, 100
# silo capacity
usedSiloStoragePercent = (100 / app.game.availableSiloStorage()) * app.game.usedSiloStorage()