This commit is contained in:
Aaron Mueller 2014-12-07 18:50:10 +01:00
parent a20bfd6dab
commit ddceb2fd45
2 changed files with 7 additions and 2 deletions

View file

@ -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", "end"
@currentHoveredTile = new Tile
ready: ->

View file

@ -41,6 +41,10 @@ app.game =
app.game.speechbubble.setMouse()
render: ->
if @gameEndCheck()
app.layer.drawImage app.images.end, 0, 0, 20*8, 15*8
return
for tile, i in @map
y = Math.floor(i/20)
x = i-(y*20)
@ -204,6 +208,7 @@ app.game =
solarpanelCount: ->
energy = 0
for tile in app.game.map
# FIXME: Thats not a sane solution hahahah :D
energy += 1 if tile.entity and tile.entity.energyProvided > 10
energy