ld31-space-diggers/src/game.coffee

23 lines
357 B
CoffeeScript
Raw Normal View History

2014-12-06 12:37:57 +01:00
app.game =
2014-12-06 08:37:36 +01:00
start: ->
2014-12-06 10:34:53 +01:00
for i in [0..20*15]
@map[i] = new Tile
2014-12-06 08:37:36 +01:00
2014-12-06 10:34:53 +01:00
render: ->
2014-12-06 14:52:03 +01:00
app.layer.save().scale(3, 3)
2014-12-06 12:37:57 +01:00
for tile, i in @map
tile.render(i-(Math.floor(i/20)*20), Math.floor(i/20))
2014-12-06 14:14:32 +01:00
app.layer.restore()
2014-12-06 12:55:43 +01:00
@hud.render()
2014-12-06 09:24:36 +01:00
2014-12-06 08:37:36 +01:00
step: ->
2014-12-06 10:34:53 +01:00
map: []
2014-12-06 08:37:36 +01:00
resources:
2014-12-06 14:14:32 +01:00
stardust: 10
bedrock: 1
2014-12-06 13:14:15 +01:00
lubinit: 0
oxodum: 0
notch: 0