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
|
@map[i] = new Tile
|
||||||
|
|
||||||
render: ->
|
render: ->
|
||||||
|
app.layer.save().scale(5, 5)
|
||||||
|
|
||||||
for tile, i in @map
|
for tile, i in @map
|
||||||
y = Math.floor(i/20)
|
y = Math.floor(i/20)
|
||||||
x = i-(y*20)
|
x = i-(y*20)
|
||||||
tile.render(x, y)
|
tile.render(x, y)
|
||||||
|
|
||||||
|
app.layer.restore()
|
||||||
|
|
||||||
@hud.render()
|
@hud.render()
|
||||||
|
|
||||||
step: ->
|
step: ->
|
||||||
|
|
|
@ -5,6 +5,6 @@ app.game.hud =
|
||||||
if amount > 0
|
if amount > 0
|
||||||
app.layer
|
app.layer
|
||||||
.fillStyle "#000"
|
.fillStyle "#000"
|
||||||
.font "20px Minecraftia"
|
.font "22px Minecraftia"
|
||||||
.wrappedText(amount+" x "+type, 11, posy, 800)
|
.wrappedText(amount+" x "+type, 11, posy, 800)
|
||||||
posy += 29
|
posy += 29
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
app = playground({
|
app = playground({
|
||||||
width: 8*20,
|
width: 8*20*5,
|
||||||
height: 8*15,
|
height: 8*15*5,
|
||||||
scaleToFit: true,
|
scaleToFit: true,
|
||||||
smoothing: false,
|
smoothing: false,
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ app = playground({
|
||||||
@game.render()
|
@game.render()
|
||||||
|
|
||||||
posToTile: (x, y)->
|
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]
|
@game.map[pos]
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue