diff --git a/public/images/titlescreen.png b/public/images/titlescreen.png new file mode 100644 index 0000000..61bc499 Binary files /dev/null and b/public/images/titlescreen.png differ diff --git a/src/app.coffee b/src/app.coffee index c19b66f..174df38 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -5,7 +5,7 @@ app = playground( smoothing: false, create: -> - @loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "speechbubbles", "deadtiles", "layerdetails", "entitydetails", "buildinfo", "cursor", "info" + @loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "speechbubbles", "deadtiles", "layerdetails", "entitydetails", "buildinfo", "cursor", "info", "end" @currentHoveredTile = new Tile ready: -> diff --git a/src/game.coffee b/src/game.coffee index 33fe125..dbde3cf 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -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) @@ -138,7 +142,7 @@ app.game = else @speechbubble.say 'nosel' -# TODO: OMG refactor this ... + # TODO: OMG refactor this ... createSolarpanel: -> if @currentSelectedTile if @checkPosition(@currentSelectedTile) @@ -207,6 +211,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