diff --git a/public/images/Thumbs.db b/public/images/Thumbs.db index 4020b0f..1cc080a 100644 Binary files a/public/images/Thumbs.db and b/public/images/Thumbs.db differ diff --git a/public/images/end.png b/public/images/end.png new file mode 100644 index 0000000..1c998f8 Binary files /dev/null and b/public/images/end.png differ diff --git a/public/images/entities.png b/public/images/entities.png index ce5715e..6d018f7 100644 Binary files a/public/images/entities.png and b/public/images/entities.png differ diff --git a/public/images/entitydetails.png b/public/images/entitydetails.png index 51e86d8..4e99078 100644 Binary files a/public/images/entitydetails.png and b/public/images/entitydetails.png differ diff --git a/public/images/intro-mars_03.png b/public/images/intro-mars_03.png new file mode 100644 index 0000000..d0462f6 Binary files /dev/null and b/public/images/intro-mars_03.png differ diff --git a/public/images/intro-mars_04.png b/public/images/intro-mars_04.png new file mode 100644 index 0000000..af4945c Binary files /dev/null and b/public/images/intro-mars_04.png differ diff --git a/src/entities/solarpanel.coffee b/src/entities/solarpanel.coffee new file mode 100644 index 0000000..f267cf8 --- /dev/null +++ b/src/entities/solarpanel.coffee @@ -0,0 +1,14 @@ +class Solarpanel + tick: (tile)-> + + sprite: -> + [0, 8*3, 8, 8] + + spritedetail: -> + [0, 16*3, 16, 16] + + isMoveable: -> + false + + spaceProvided: 0 + isDockable: true diff --git a/src/game.coffee b/src/game.coffee index ca08672..fa17c66 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -64,6 +64,7 @@ app.game = keyup: (event) -> switch event.key when "m" then @createMiner() + when "e" then @createSolarpanel() when "i" then app.game.hud.showBuildInfo() when "s" then @createSilo() when "c" then @cheatah() @@ -104,9 +105,17 @@ app.game = @speechbubble.say 'nores' else @speechbubble.say 'toofar' - else - @speechbubble.say 'nosel' +# TODO: OMG refactor this ... + createSolarpanel: -> + if @currentSelectedTile + if @checkPosition(@currentSelectedTile) + if @checkResource('notch', 10, true) + @currentSelectedTile.entity = new Solarpanel + else + @speechbubble.say 'nores' + else + @speechbubble.say 'toofar' checkResource: (type, amount, drain = false) -> if @resources[type] >= amount @resources[type] -= amount if drain diff --git a/src/hud.coffee b/src/hud.coffee index 66fb659..3e24573 100644 --- a/src/hud.coffee +++ b/src/hud.coffee @@ -16,7 +16,6 @@ app.game.hud = render: -> panelusage = 'resources' - app.layer.drawImage app.images.hud, 0, 11*8 if @buildinfo @@ -29,7 +28,6 @@ app.game.hud = if currentSelectedTile != null panelusage = 'tile' - if currentSelectedTile.entity panelusage = 'entity' app.layer.drawRegion app.images.entitydetails, currentSelectedTile.entity.spritedetail(), 12, 95