master
Aaron Mueller 8 years ago
parent 8adc7d0002
commit ecfa9d7268
  1. 3
      .gitignore
  2. BIN
      public/images/HUD.png
  3. BIN
      public/images/Thumbs.db
  4. BIN
      public/images/hud.png
  5. 6
      src/game.coffee
  6. 1
      src/hud.coffee
  7. 6
      src/main.coffee

3
.gitignore vendored

@ -1,2 +1,3 @@
node_modules
public/app.js
public/app.js
.Thumbs.db

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

@ -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: []

@ -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

@ -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: ->

Loading…
Cancel
Save