End game
This commit is contained in:
parent
a20bfd6dab
commit
ddceb2fd45
2 changed files with 7 additions and 2 deletions
|
@ -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: ->
|
||||
|
|
|
@ -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)
|
||||
|
@ -135,7 +139,7 @@ app.game =
|
|||
else
|
||||
@speechbubble.say 'nosel'
|
||||
|
||||
# TODO: OMG refactor this ...
|
||||
# TODO: OMG refactor this ...
|
||||
createSolarpanel: ->
|
||||
if @currentSelectedTile
|
||||
if @checkPosition(@currentSelectedTile)
|
||||
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue