This commit is contained in:
Aaron Mueller 2014-12-06 10:34:53 +01:00
parent cc95f8f36f
commit 374ccd95ce
4 changed files with 20 additions and 23 deletions

View file

@ -21,10 +21,9 @@ gulp.task('server', function() {
}); });
gulp.task('compile', function() { gulp.task('compile', function() {
return gulp.src(['src/**/*.coffee']) return gulp.src(['src/entities/*.coffee', 'src/main.coffee', 'src/game.coffee'])
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(coffee({bare: true})) .pipe(coffee({bare: true}))
.pipe(uglify())
.pipe(concat('app.js')) .pipe(concat('app.js'))
.pipe(sourcemaps.write()) .pipe(sourcemaps.write())
.pipe(gulp.dest('public')); .pipe(gulp.dest('public'));

View file

@ -10,8 +10,6 @@ class Tile extends Base_entity
new Tilelayer type: 'gold' new Tilelayer type: 'gold'
] ]
console.log @layers
tick: (delta) -> tick: (delta) ->
# TODO: digging deeper? # TODO: digging deeper?

View file

@ -1,15 +1,21 @@
game = { app.game = {
start: -> start: ->
for i in [0..20*15]
@map[i] = new Tile
hud: -> hud: ->
app app.layer
.layer
.fillStyle "#00f" .fillStyle "#00f"
.fillRect 0, 0, 200, 50 .fillRect 0, 0, 200, 50
render: ->
for i in @map
i.render()
step: -> step: ->
this.hud @hud
map: []
resources: resources:
ore: 50 ore: 50

View file

@ -1,25 +1,19 @@
app = playground({ app = playground({
width: 16*20, width: 8*20,
height: 16*20, height: 8*15,
scaleToFit: true, scaleToFit: true,
smoothing: false, smoothing: false,
createTestTiles: ->
@testTile1 = new Tile
@testTile2 = new Tile
create: -> create: ->
@createTestTiles()
ready: -> ready: ->
game.start @game.start()
@setState game @setState @game
step: -> step: ->
render: -> render: ->
this.layer.clear("#000"); @layer.clear("#00f");
@game.render
@testTile1.render()
@testTile2.render()
}) })