This commit is contained in:
Ruben Müller 2014-12-07 18:41:43 +01:00
commit 3a506cc908
15 changed files with 24 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -22,4 +22,5 @@ class Base
@frame += 1 @frame += 1
spaceProvided: 300 spaceProvided: 300
energyProvided: 7
isDockable: true isDockable: true

View file

@ -22,4 +22,5 @@ class Miner
@frame += 1 @frame += 1
spaceProvided: 5 spaceProvided: 5
energyProvided: 0
isDockable: false isDockable: false

View file

@ -21,6 +21,7 @@ class Silo
@frame += 1 @frame += 1
spaceProvided: 150 spaceProvided: 150
energyProvided: 0
isDockable: true isDockable: true

View file

@ -11,4 +11,5 @@ class Solarpanel
false false
spaceProvided: 0 spaceProvided: 0
energyProvided: 15
isDockable: true isDockable: true

View file

@ -4,6 +4,8 @@ app.game =
@map[i] = new Tile(i) @map[i] = new Tile(i)
@map[20*5+10].entity = new Base @map[20*5+10].entity = new Base
# TODO: BUG BUG: ... the base is some time replaced by a tile ...
@mouseX = 0 @mouseX = 0
@mouseY = 0 @mouseY = 0
@currentHoveredTile = new Tile(-1) @currentHoveredTile = new Tile(-1)
@ -199,6 +201,16 @@ app.game =
space += amount for resource, amount of @resources space += amount for resource, amount of @resources
space space
solarpanelCount: ->
energy = 0
for tile in app.game.map
energy += 1 if tile.entity and tile.entity.energyProvided > 10
energy
gameEndCheck: ->
return true if @solarpanelCount() >= 4
false
resources: resources:
stardust: 0 stardust: 0
dirt: 0 dirt: 0

View file

@ -48,9 +48,16 @@ app.game.hud =
x = 44+f x = 44+f
y = 112 y = 112
app.layer.setPixel(resourcePanelColor, x, y) app.layer.setPixel(resourcePanelColor, x, y)
# Energy production (47)
length = Math.round(((25*app.game.solarpanelCount())*45)/100)
for i in [0..length]
app.layer.setPixel("#228ca5", 49+i, 91)
app.layer.setPixel("#8ddaed", 50+i, 92)
app.layer.setPixel("#228ca5", 49+i, 93)
switch panelusage switch panelusage
when 'tile' when 'tile'
@showResources() @showResources()