2014-12-06 17:17:30 +01:00
|
|
|
app = playground(
|
2014-12-06 19:01:21 +01:00
|
|
|
width: 8*20,
|
|
|
|
height: 8*15,
|
2014-12-06 15:57:02 +01:00
|
|
|
scaleToFit: true,
|
2014-12-06 09:24:36 +01:00
|
|
|
smoothing: false,
|
2014-12-06 15:57:02 +01:00
|
|
|
|
2014-12-06 09:24:36 +01:00
|
|
|
create: ->
|
2014-12-07 14:02:42 +01:00
|
|
|
@loadImages "layers", "active", "progress", "selected", "entities", "hud", "actions"
|
2014-12-06 15:57:02 +01:00
|
|
|
@currentHoveredTile = new Tile
|
2014-12-06 09:24:36 +01:00
|
|
|
|
|
|
|
ready: ->
|
2014-12-06 10:34:53 +01:00
|
|
|
@game.start()
|
|
|
|
@setState @game
|
2014-12-06 15:57:02 +01:00
|
|
|
|
2014-12-06 09:24:36 +01:00
|
|
|
render: ->
|
2014-12-06 15:57:02 +01:00
|
|
|
@layer.clear "#00f"
|
|
|
|
@game.render()
|
|
|
|
|
2014-12-06 17:17:30 +01:00
|
|
|
layerIndexToName: (index)->
|
|
|
|
resTypes = (k for own k of @game.resources)
|
|
|
|
resTypes[index]
|
|
|
|
)
|