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, smoothing: false,
create: -> 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 @currentHoveredTile = new Tile
ready: -> ready: ->

View file

@ -41,6 +41,10 @@ app.game =
app.game.speechbubble.setMouse() app.game.speechbubble.setMouse()
render: -> render: ->
if @gameEndCheck()
app.layer.drawImage app.images.end, 0, 0, 20*8, 15*8
return
for tile, i in @map for tile, i in @map
y = Math.floor(i/20) y = Math.floor(i/20)
x = i-(y*20) x = i-(y*20)
@ -135,7 +139,7 @@ app.game =
else else
@speechbubble.say 'nosel' @speechbubble.say 'nosel'
# TODO: OMG refactor this ... # TODO: OMG refactor this ...
createSolarpanel: -> createSolarpanel: ->
if @currentSelectedTile if @currentSelectedTile
if @checkPosition(@currentSelectedTile) if @checkPosition(@currentSelectedTile)
@ -204,6 +208,7 @@ app.game =
solarpanelCount: -> solarpanelCount: ->
energy = 0 energy = 0
for tile in app.game.map 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 += 1 if tile.entity and tile.entity.energyProvided > 10
energy energy