Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions GruntFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

clean: {
assets: ["deploy/assets"],
js: ["deploy/js/*.js", "!deploy/js/*.min.js"]
},

connect: {
server: {
options: {
Expand All @@ -23,16 +31,30 @@ module.exports = function (grunt) {
}
},
watch: {
files: 'src/**/*.js',
tasks: ['concat']
source: {
files: 'src/**/*.js',
tasks: ['clean:js', 'concat']
},
assets: {
files: 'src/assets/*.*',
tasks: ['clean:assets', 'copy']
}
},
copy: {
files: {
cwd: 'src/assets',
src: '**/*',
dest: 'deploy/assets',
expand: true
}
},
open: {
dev: {
path: 'http://localhost:8080/index.html'
}
}
});

grunt.registerTask('default', ['concat', 'connect', 'open', 'watch']);
grunt.registerTask('default', ['clean', 'concat', 'copy', 'connect', 'open', 'watch']);

}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"grunt": "~0.4.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-connect": "~0.6.0"
"grunt-contrib-connect": "~0.6.0",
"grunt-contrib-copy": "~0.7.0",
"grunt-contrib-clean": "~0.6.0"
}
}
Empty file added src/assets/assets_here
Empty file.
22 changes: 5 additions & 17 deletions src/game/main.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
/**
*
* This is a simple state template to use for getting a Phaser game up
* and running quickly. Simply add your own game logic to the default
* state object or delete it and make your own.
*
*/

var state = {
init: function() {
// Delete this init block or replace with your own logic.

// Create simple text display for current Phaser version
var text = "Phaser Version "+Phaser.VERSION + " works!";
var text = "Phaser Version " + Phaser.VERSION + " works!";
var style = { font: "24px Arial", fill: "#fff", align: "center" };
var t = game.add.text(this.world.centerX, this.world.centerY, text, style);
t.anchor.setTo(0.5, 0.5);

},
},
preload: function() {
// STate preload logic goes here

},
create: function(){
// State create logic goes here

},
update: function() {
// State Update Logic goes here.

}
};

Expand Down