From 81548836a173290d754b76399959bc7d25baf8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ruben=20M=C3=BCller?= Date: Sat, 6 Dec 2014 17:17:33 +0100 Subject: [PATCH] Working on miners --- src/entities/miner.coffee | 3 +++ src/game.coffee | 3 +++ src/main.coffee | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/entities/miner.coffee 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: ->