-
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 d505755
Showing
18 changed files
with
1,012 additions
and
0 deletions.
There are no files selected for viewing
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,2 @@ | ||
dist/ | ||
node_modules |
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,50 @@ | ||
# gulpjs-phaser | ||
|
||
An awesome combination. Develop games faster, with less friction with | ||
tooling. | ||
|
||
|
||
* Phaser game engine | ||
* Gulp.js for blazing-fast, maintainable builds | ||
* Static server and Live-Reload for faster turnaround times | ||
* Mini platformer from the phaser tutorial set up | ||
* Coffeescript for sane, succint code and build | ||
* Sass for awesome style | ||
|
||
|
||
## Getting started | ||
|
||
You need to have [node.js](http://nodejs.org/) installed on your machine. | ||
|
||
|
||
1. Install the [Chrome live-reload](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en) extension | ||
|
||
2. Set up your project: | ||
|
||
``` | ||
$ git clone git@github.com:jondot/gulpjs-phaser.git && cd gulpjs-phaser | ||
$ npm install -g gulp && npm install | ||
$ gulp | ||
$ open http://localhost:3000 | ||
``` | ||
|
||
3. Edit your code and watch everything update automagically. | ||
|
||
|
||
# Contributing | ||
|
||
Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :). | ||
|
||
## Thanks | ||
|
||
* Build inspired by [this post](http://filmic.eu/blog/build-a-web-project-using-gulpjs/) | ||
|
||
|
||
# Copyright | ||
|
||
Copyright (c) 2014 [Dotan Nahum](http://gplus.to/dotan) [@jondot](http://twitter.com/jondot). See MIT-LICENSE for further details. | ||
|
||
|
||
|
||
|
||
|
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,87 @@ | ||
gulp = require 'gulp' | ||
gutil = require 'gulp-util' | ||
gulpif = require 'gulp-if' | ||
|
||
coffee = require 'gulp-coffee' | ||
browserify = require 'gulp-browserify' | ||
concat = require 'gulp-concat' | ||
uglify = require 'gulp-uglify' | ||
sass = require 'gulp-sass' | ||
refresh = require 'gulp-livereload' | ||
imagemin = require 'gulp-imagemin' | ||
|
||
connect = require 'connect' | ||
http = require 'http' | ||
path = require 'path' | ||
lr = require 'tiny-lr' | ||
server = lr() | ||
rmdir = require 'rimraf' | ||
|
||
gulp.task 'webserver', -> | ||
port = 3000 | ||
hostname = null | ||
base = path.resolve 'dist' | ||
directory = path.resolve 'dist' | ||
|
||
app = connect() | ||
.use connect.static base | ||
.use connect.directory directory | ||
|
||
http.createServer(app).listen port, hostname | ||
|
||
# Starts the livereload server | ||
gulp.task 'livereload', -> | ||
server.listen 35729, (err) -> | ||
console.log err if err? | ||
|
||
gulp.task 'vendor', -> | ||
gulp.src 'scripts/vendor/*.js' | ||
.pipe concat 'vendor.js' | ||
.pipe gulp.dest 'dist/assets/' | ||
.pipe refresh server | ||
|
||
gulp.task 'scripts', -> | ||
gulp.src 'scripts/coffee/app.coffee', read: false | ||
.pipe browserify transform: ['coffeeify'], extensions: ['.coffee'], debug: !gutil.env.production | ||
.pipe concat 'scripts.js' | ||
.pipe gulpif gutil.env.production, uglify() | ||
.pipe gulp.dest 'dist/assets/' | ||
.pipe refresh server | ||
|
||
gulp.task 'styles', -> | ||
gulp.src 'styles/scss/init.scss' | ||
.pipe sass includePaths: ['styles/scss/includes'] | ||
.pipe concat 'styles.css' | ||
.pipe gulp.dest 'dist/assets/' | ||
.pipe refresh server | ||
|
||
gulp.task 'html', -> | ||
gulp.src '*.html' | ||
.pipe gulp.dest 'dist/' | ||
.pipe refresh server | ||
|
||
gulp.task 'images', -> | ||
gulp.src 'resources/images/**' | ||
.pipe imagemin() | ||
.pipe gulp.dest 'dist/assets/images/' | ||
.pipe refresh server | ||
|
||
gulp.task 'sounds', -> | ||
gulp.src 'resources/sounds/**' | ||
.pipe gulp.dest 'dist/assets/sounds/' | ||
.pipe refresh server | ||
|
||
gulp.task 'watch', -> | ||
gulp.watch 'scripts/vendor/**', ['vendor'] | ||
gulp.watch 'scripts/coffee/**', ['scripts'] | ||
gulp.watch 'styles/scss/**', ['styles'] | ||
gulp.watch 'resources/images/**', ['images'] | ||
gulp.watch 'resources/sounds/**', ['sounds'] | ||
gulp.watch '*.html', ['html'] | ||
|
||
gulp.task 'clean', -> | ||
rmdir 'dist', () -> | ||
|
||
gulp.task 'build', ['clean', 'vendor', 'scripts', 'styles', 'images', 'sounds', 'html'] | ||
|
||
gulp.task 'default', ['webserver', 'livereload', 'build', '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,2 @@ | ||
require('coffee-script/register') | ||
require('./gulpfile.coffee') |
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,10 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<link type="text/css" rel="stylesheet" media="all" | ||
href="assets/styles.css"> | ||
</head> | ||
<body> | ||
<script src="assets/vendor.js"></script> | ||
<script src="assets/scripts.js"></script> | ||
</body> |
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,29 @@ | ||
{ | ||
"name": "gulpjs-phaser", | ||
"author": { | ||
"name": "Dotan Nahum", | ||
"email": "jondotan@gmail.com", | ||
"url": "http://github.com/jondot/gulpjs-phaser" | ||
}, | ||
"version": "0.0.1", | ||
"description": "", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"connect": "~2.12.0", | ||
"gulp": "~3.5.0", | ||
"gulp-coffee": "~1.4.0", | ||
"gulp-concat": "~2.1.7", | ||
"gulp-livereload": "~0.3.0", | ||
"gulp-sass": "~0.6.0", | ||
"gulp-uglify": "~0.2.0", | ||
"gulp-util": "~2.2.13", | ||
"tiny-lr": "0.0.5", | ||
"coffee-script": "~1.7.1", | ||
"gulp-browserify": "~0.4.0", | ||
"coffeeify": "~0.6.0", | ||
"gulp-imagemin": "~0.1.4", | ||
"gulp-if": "~0.0.5", | ||
"rimraf": "~2.2.6" | ||
}, | ||
"repository": {} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.