Pixelfont is back
This commit is contained in:
parent
efd34b8b5d
commit
c66e9a68b5
3 changed files with 9 additions and 4 deletions
|
@ -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: ->
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue