Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rybar committed Aug 14, 2017
0 parents commit d0611ec
Show file tree
Hide file tree
Showing 40 changed files with 8,439 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.c9
node_modules/
bower_components/
.idea
173 changes: 173 additions & 0 deletions Gruntfile.js
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']);
};
3 changes: 3 additions & 0 deletions README.md
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'.
Loading

0 comments on commit d0611ec

Please sign in to comment.