diff --git a/.gitignore b/.gitignore index 50e1d6a..c005620 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -public/app.js \ No newline at end of file +public/app.js +.Thumbs.db diff --git a/public/images/HUD.png b/public/images/HUD.png deleted file mode 100644 index cd09c62..0000000 Binary files a/public/images/HUD.png and /dev/null differ diff --git a/public/images/Thumbs.db b/public/images/Thumbs.db deleted file mode 100644 index 4f078e6..0000000 Binary files a/public/images/Thumbs.db and /dev/null differ diff --git a/public/images/hud.png b/public/images/hud.png new file mode 100644 index 0000000..afb5681 Binary files /dev/null and b/public/images/hud.png differ diff --git a/src/game.coffee b/src/game.coffee index 375941f..69b71d5 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -9,15 +9,11 @@ app.game = @currentSelectedTile = new Tile render: -> - app.layer.save().scale(5, 5) - for tile, i in @map y = Math.floor(i/20) x = i-(y*20) tile.render(x, y) - app.layer.restore() - @hud.render() step: -> @@ -53,7 +49,7 @@ app.game = @currentSelectedTile.attachMiner newMiner posToTile: (x, y)-> - pos = (Math.floor(y/8/5)*20) + Math.floor(x/8/5) + pos = (Math.floor(y/8)*20) + Math.floor(x/8) @map[pos] map: [] diff --git a/src/hud.coffee b/src/hud.coffee index 32d96f1..be7f855 100644 --- a/src/hud.coffee +++ b/src/hud.coffee @@ -1,5 +1,6 @@ app.game.hud = render: -> + app.layer.drawImage app.images.hud, 0, 12*8+2 posy = 49 for type, amount of app.game.resources if amount > 0 diff --git a/src/main.coffee b/src/main.coffee index 5d7a67a..5261f5c 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -1,11 +1,11 @@ app = playground( - width: 8*20*5, - height: 8*15*5, + width: 8*20, + height: 8*15, scaleToFit: true, smoothing: false, create: -> - @loadImages "layers", "active", "selected", "entities" + @loadImages "layers", "active", "selected", "entities", "hud" @currentHoveredTile = new Tile ready: ->