diff --git a/gulpfile.js b/gulpfile.js index 57580f0..ce41c01 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,7 +21,7 @@ gulp.task('server', function() { }); gulp.task('compile', function() { - return gulp.src(['src/entities/*.coffee', 'src/tools.coffee', 'src/main.coffee', 'src/game.coffee', 'src/hud.coffee']) + return gulp.src(['src/entities/*.coffee', 'src/tiles/*.coffee', 'src/tools.coffee', 'src/app.coffee', 'src/game.coffee', 'src/hud.coffee']) .pipe(sourcemaps.init()) .pipe(coffee({bare: true})) .pipe(concat('app.js')) diff --git a/src/main.coffee b/src/app.coffee similarity index 100% rename from src/main.coffee rename to src/app.coffee diff --git a/src/entities/base_entity.coffee b/src/entities/base_entity.coffee deleted file mode 100644 index 1ce1d82..0000000 --- a/src/entities/base_entity.coffee +++ /dev/null @@ -1,3 +0,0 @@ -class BaseEntity - constructor: (options) -> - {} = options diff --git a/src/entities/miner.coffee b/src/entities/miner.coffee index 8b817d7..8bd3b2d 100644 --- a/src/entities/miner.coffee +++ b/src/entities/miner.coffee @@ -1,3 +1,3 @@ -class Miner extends BaseEntity +class Miner tick: (tile) -> tile.click "left" diff --git a/src/entities/tile.coffee b/src/tiles/tile.coffee similarity index 95% rename from src/entities/tile.coffee rename to src/tiles/tile.coffee index 753f7b2..ce9a8f5 100644 --- a/src/entities/tile.coffee +++ b/src/tiles/tile.coffee @@ -1,7 +1,5 @@ -class Tile extends BaseEntity - constructor: (options) -> - super options - +class Tile + constructor: -> resTypes = (k for own k of app.game.resources) @layers = [] diff --git a/src/entities/tilelayer.coffee b/src/tiles/tilelayer.coffee similarity index 86% rename from src/entities/tilelayer.coffee rename to src/tiles/tilelayer.coffee index a22da6c..3882592 100644 --- a/src/entities/tilelayer.coffee +++ b/src/tiles/tilelayer.coffee @@ -1,4 +1,4 @@ -class Tilelayer extends BaseEntity +class Tilelayer constructor: (options)-> {@type, @depth, @amount} = options @randomFactor = getRandomInt 0, 4