Pimp the GFX and make dead tiles
This commit is contained in:
parent
82e5a55d24
commit
30f72a3135
5 changed files with 11 additions and 3 deletions
|
@ -8,4 +8,6 @@ Title: Entire game on one screen
|
||||||
** "tote" flächen einbauen (krater, berge) :jonas:aaron:
|
** "tote" flächen einbauen (krater, berge) :jonas:aaron:
|
||||||
** Spielstart in irgend einer weise ... (grafik)
|
** Spielstart in irgend einer weise ... (grafik)
|
||||||
** Hint für shortcuts anzeigen :ruben:
|
** 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
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 |
|
@ -5,7 +5,7 @@ app = playground(
|
||||||
smoothing: false,
|
smoothing: false,
|
||||||
|
|
||||||
create: ->
|
create: ->
|
||||||
@loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions"
|
@loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions", "deadtiles"
|
||||||
@currentHoveredTile = new Tile
|
@currentHoveredTile = new Tile
|
||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
|
|
|
@ -6,12 +6,14 @@ class Tile
|
||||||
@layers.push new Tilelayer(
|
@layers.push new Tilelayer(
|
||||||
type: restype,
|
type: restype,
|
||||||
depth: i,
|
depth: i,
|
||||||
amount: Math.round(Math.random(app.game.maxTileAmount-10)+10)
|
amount: Math.round(Math.random()*app.game.maxTileAmount)+1
|
||||||
)
|
)
|
||||||
|
|
||||||
@currentLayer = 0
|
@currentLayer = 0
|
||||||
@entity = null
|
@entity = null
|
||||||
@isActive = false
|
@isActive = false
|
||||||
|
@isBuildable = !(Math.round(Math.random()*10) == 5)
|
||||||
|
@randomSeed = Math.round(Math.random()*10)
|
||||||
|
|
||||||
click: (button)->
|
click: (button)->
|
||||||
if button == "left"
|
if button == "left"
|
||||||
|
@ -46,6 +48,10 @@ class Tile
|
||||||
tileLayer = @getCurrentLayer()
|
tileLayer = @getCurrentLayer()
|
||||||
app.layer.drawRegion app.images.layers, tileLayer.sprite, x*8, y*8
|
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
|
if @entity
|
||||||
app.layer.drawRegion app.images.entities, @entity.sprite(), x*8, y*8
|
app.layer.drawRegion app.images.entities, @entity.sprite(), x*8, y*8
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue