Pimp the GFX and make dead tiles

This commit is contained in:
Aaron Mueller 2014-12-07 15:47:42 +01:00
parent 82e5a55d24
commit 30f72a3135
5 changed files with 11 additions and 3 deletions

View File

@ -8,4 +8,6 @@ Title: Entire game on one screen
** "tote" flächen einbauen (krater, berge) :jonas:aaron:
** Spielstart in irgend einer weise ... (grafik)
** Hint für shortcuts anzeigen :ruben:
** Preise für entities :ruben:
** Preise für entities :ruben:
** Silos: Farben je nach Kapazität einfärben
** Game balancing :D

BIN
public/images/deadtiles.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -5,7 +5,7 @@ app = playground(
smoothing: false,
create: ->
@loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions"
@loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "deadtiles"
@currentHoveredTile = new Tile
ready: ->

View File

@ -6,12 +6,14 @@ class Tile
@layers.push new Tilelayer(
type: restype,
depth: i,
amount: Math.round(Math.random(app.game.maxTileAmount-10)+10)
amount: Math.round(Math.random()*app.game.maxTileAmount)+1
)
@currentLayer = 0
@entity = null
@isActive = false
@isBuildable = !(Math.round(Math.random()*10) == 5)
@randomSeed = Math.round(Math.random()*10)
click: (button)->
if button == "left"
@ -46,6 +48,10 @@ class Tile
tileLayer = @getCurrentLayer()
app.layer.drawRegion app.images.layers, tileLayer.sprite, x*8, y*8
unless @isBuildable
app.layer.drawRegion app.images.deadtiles, [8*@randomSeed, 0, 8, 8], x*8, y*8
return
if @entity
app.layer.drawRegion app.images.entities, @entity.sprite(), x*8, y*8