diff --git a/src/entities/miner.coffee b/src/entities/miner.coffee new file mode 100644 index 0000000..17fb8c8 --- /dev/null +++ b/src/entities/miner.coffee @@ -0,0 +1,3 @@ +class Miner extends BaseEntity + render: (x, y)-> + app.layer.drawRegion app.entities.layers, [8, 0, 8, 8], x, y diff --git a/src/game.coffee b/src/game.coffee index c67af58..9f0eef3 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -3,6 +3,9 @@ app.game = for i in [0..20*15-1] @map[i] = new Tile + @miners = [] + @miners.push = new Miner + render: -> app.layer.save().scale(5, 5) diff --git a/src/main.coffee b/src/main.coffee index 4d45739..68890a4 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -5,7 +5,7 @@ app = playground({ smoothing: false, create: -> - @loadImages "layers", "active", "selected" + @loadImages "layers", "active", "selected", "entities" @currentHoveredTile = new Tile ready: ->