From c66e9a68b5253189707c742391b176d451a473db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ruben=20M=C3=BCller?= Date: Sat, 6 Dec 2014 16:49:29 +0100 Subject: [PATCH] Pixelfont is back --- src/game.coffee | 5 +++++ src/hud.coffee | 2 +- src/main.coffee | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/game.coffee b/src/game.coffee index 9ce5570..c67af58 100644 --- a/src/game.coffee +++ b/src/game.coffee @@ -4,10 +4,15 @@ app.game = @map[i] = 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: -> diff --git a/src/hud.coffee b/src/hud.coffee index fb2abc6..32d96f1 100644 --- a/src/hud.coffee +++ b/src/hud.coffee @@ -5,6 +5,6 @@ app.game.hud = if amount > 0 app.layer .fillStyle "#000" - .font "20px Minecraftia" + .font "22px Minecraftia" .wrappedText(amount+" x "+type, 11, posy, 800) posy += 29 diff --git a/src/main.coffee b/src/main.coffee index 569a43f..b44a511 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -1,6 +1,6 @@ app = playground({ - width: 8*20, - height: 8*15, + width: 8*20*5, + height: 8*15*5, scaleToFit: true, smoothing: false, @@ -29,7 +29,7 @@ app = playground({ @game.render() posToTile: (x, y)-> - pos = (Math.floor(y/8)*20) + Math.floor(x/8) + pos = (Math.floor(y/8/5)*20) + Math.floor(x/8/5) @game.map[pos] })