From ddceb2fd4537020be4d409611b97bb774ca354f7 Mon Sep 17 00:00:00 2001 From: Aaron Mueller Date: Sun, 7 Dec 2014 18:50:10 +0100 Subject: [PATCH 1/3] End game --- src/app.coffee | 2 +- src/game.coffee | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app.coffee b/src/app.coffee index f90657b..afa978a 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" + @loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "speechbubbles", "deadtiles", "layerdetails", "entitydetails", "buildinfo", "cursor", "end" @currentHoveredTile = new Tile ready: -> diff --git a/src/game.coffee b/src/game.coffee index 747907c..71102aa 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) @@ -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 From c98464bec0dabb44b8cb2e901bce9e5bdf676b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ruben=20M=C3=BCller?= Date: Sun, 7 Dec 2014 18:53:30 +0100 Subject: [PATCH 2/3] Info button --- public/images/info.png | Bin 0 -> 1032 bytes src/app.coffee | 2 +- src/game.coffee | 11 +++++++---- src/hud.coffee | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 public/images/info.png diff --git a/public/images/info.png b/public/images/info.png new file mode 100644 index 0000000000000000000000000000000000000000..274a2a6512f63b9d23c3fae13d647eb96ce7dacf GIT binary patch literal 1032 zcmaJ=-%ry}6fS}WP)Jl_fcQ|04`^7scC5>q4eZ+CmaMppDNBq$N_*Lw(caQtSec0= ziVr3{=#w!a;2&V{g*P7{JQ(}~jK+kh??fJXF~-}m4IiA%P4BrU=ljk%_k8zxcJgLV z_h2_c5IyOXoWr|spX)q>|98tHZ}2vNk_9vcXHi9U03qsd29Rk}ErJ|S^`-fbAVv`F zSB-oD6_kviL6cVf7}_&!j3$WKxM!pTur{$p%agxNyPI@Ze^L{8Y9eIY33w$wN5T zxW#M%^#mRJTC!}z29Yt#)F){k#Cg^LeO=>rSv-NC~Cl#tf(qo}53G4Fkyi7h`4wfFrh z?)3JH9cMEyx3+rk+`hGOzinV=Z)G!;$(&zRiR(ujr}tN;-~H6Wue - @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", "info" @currentHoveredTile = new Tile ready: -> diff --git a/src/game.coffee b/src/game.coffee index 747907c..33fe125 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -57,11 +57,14 @@ app.game = if @isMouseInView event.x/8, event.y/8 switch event.button when 'left' - tile.click(event.button) + if event.x > 143 and event.x < 151 and event.y > 95 and event.y < 106 + app.game.hud.showBuildInfo() + else + tile.click(event.button) - @currentSelectedTile.deselect() if @currentSelectedTile - tile.select() - @currentSelectedTile = tile + @currentSelectedTile.deselect() if @currentSelectedTile + tile.select() + @currentSelectedTile = tile when 'right' @currentSelectedTile.deselect() if @currentSelectedTile @currentSelectedTile = null diff --git a/src/hud.coffee b/src/hud.coffee index 7b10a23..e295940 100644 --- a/src/hud.coffee +++ b/src/hud.coffee @@ -18,6 +18,8 @@ app.game.hud = panelusage = 'resources' app.layer.drawImage app.images.hud, 0, 11*8 + app.layer.drawImage app.images.info, 143, 95 + # cursor # app.layer.drawImage app.images.cursor, app.game.mouseX, app.game.mouseY From b2813308a8f3cbfd7582bdc09b6903c3ddc60985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ruben=20M=C3=BCller?= Date: Sun, 7 Dec 2014 18:56:16 +0100 Subject: [PATCH 3/3] Update notes --- notes.org | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/notes.org b/notes.org index 21e841d..500acc7 100644 --- a/notes.org +++ b/notes.org @@ -1,10 +1,4 @@ Title: Entire game on one screen -* TODO INTRO -** intro grafiken einbauen - -* TODO HUD -** i key - -* TODO OUTRO -** win screen \ No newline at end of file +* TODO +** release \ No newline at end of file