forked from Rybar/js13k2017
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d0611ec
Showing
40 changed files
with
8,439 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.git | ||
.c9 | ||
node_modules/ | ||
bower_components/ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
module.exports = function(grunt) { | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
watch: { | ||
|
||
scripts: { | ||
files: ['src/js/**/*.js'], | ||
tasks: ['concat:dist', 'uglify:development'], | ||
}, | ||
css: { | ||
files: 'src/css/**/*.less', | ||
tasks: ['less:development'] | ||
} | ||
|
||
}, | ||
|
||
concat : { | ||
dist : { | ||
src : [ | ||
//'src/js/lib/stats.js', | ||
|
||
'src/js/first.js', | ||
'src/js/lib/sonantx.js', | ||
'src/js/assets.js', | ||
'src/js/lib/Engine.js', | ||
|
||
'src/js/main.js', | ||
'src/js/lib/sound.js', | ||
'src/js/states/gameoverstate.js', | ||
'src/js/states/menustate.js', | ||
'src/js/states/gamestate.js', | ||
|
||
//'src/js/lib/CCapture.all.min.js', | ||
|
||
'src/js/lib/input.js', | ||
'src/js/lib/txt.js', | ||
|
||
'src/js/last.js' | ||
], | ||
dest : 'build/concat.js' | ||
} | ||
}, | ||
|
||
inline: { | ||
dist: { | ||
options:{ | ||
tag: '', | ||
cssmin: true | ||
}, | ||
src: 'build/index.html', | ||
dest: 'dist/index.html' | ||
} | ||
}, | ||
|
||
uglify: { | ||
development: { | ||
options: { | ||
mangle: false, | ||
}, | ||
files: { | ||
'build/game.js': | ||
[ | ||
'build/concat.js' | ||
] | ||
} | ||
}, | ||
compressed: { | ||
options: { | ||
//reserveDOMCache: true, | ||
nameCache: 'grunt-uglify-cache.json', | ||
mangle: { | ||
properties: { | ||
builtins: false, | ||
regex: /MusicGenerator|getAudioGenerator|osc1_oct|oscSawtooth|osc1_det|osc1_detune/ | ||
//domprops: false, | ||
|
||
} | ||
} | ||
//mangle: true | ||
|
||
|
||
}, | ||
|
||
files: { | ||
'build/game.js': | ||
[ | ||
'build/concat.js' | ||
] | ||
} | ||
} | ||
}, | ||
less: { | ||
development: { | ||
files: { | ||
"build/style.css": "src/css/*.less" | ||
} | ||
}, | ||
compressed: { | ||
files: { | ||
"build/style.css": "src/css/*.less" | ||
}, | ||
compress: true, | ||
} | ||
}, | ||
|
||
htmlmin: { | ||
development: { | ||
options: { | ||
removeComments: false, | ||
collapseWhitespace: false, | ||
}, | ||
files: { | ||
'build/index.html': 'src/index.html' | ||
} | ||
}, | ||
compressed: { | ||
options: { | ||
removeComments: true, | ||
collapseWhitespace: true, | ||
}, | ||
files: { | ||
'build/index.html': 'src/index.html' | ||
} | ||
} | ||
}, | ||
|
||
compress: { | ||
main: { | ||
options: { | ||
archive: 'dist/game.zip', | ||
mode: 'zip', | ||
level: 9, | ||
}, | ||
files: [{ | ||
expand: true, | ||
flatten: true, | ||
cwd: './', | ||
src: ['dist/index.html'], | ||
dest: './' | ||
}] | ||
} | ||
} | ||
}) | ||
|
||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-contrib-less'); | ||
grunt.loadNpmTasks('grunt-contrib-htmlmin'); | ||
grunt.loadNpmTasks('grunt-contrib-compress'); | ||
grunt.loadNpmTasks('grunt-contrib-concat'); | ||
grunt.loadNpmTasks('grunt-inline'); | ||
|
||
var fs = require('fs'); | ||
grunt.registerTask('sizecheck', function() { | ||
var done = this.async(); | ||
fs.stat('dist/game.zip', function(err, zip) { | ||
if (zip.size > 13312) { | ||
//If size in bytes greater than 13kb | ||
grunt.log.error("Zipped file greater than 13kb \x07 \n"); | ||
grunt.log.error("Zip is " + zip.size + " bytes when js13k max is 13,312 bytes"); | ||
} | ||
done(); | ||
}); | ||
}); | ||
|
||
grunt.registerTask('default', ['watch']); | ||
grunt.registerTask('build', ['concat:dist', 'less:development', 'htmlmin:development',] ); | ||
grunt.registerTask('build-compress', ['concat:dist', 'less:compressed', 'htmlmin:compressed', 'uglify:compressed', 'inline:dist', 'compress:main', 'sizecheck']); | ||
//grunt.registerTask('build-compress', ['concat:dist','closure-compiler', 'less:compressed', 'htmlmin:compressed', 'inline:dist', 'compress:main', 'sizecheck']); | ||
//grunt.registerTask('server', ['concat:dist','express','watch']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# JS13K 2017 | ||
|
||
So it begins! The theme this year is 'lost'. |
Oops, something went wrong.