Skip to content

Commit

Permalink
TimerFixer init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcneilly committed Feb 24, 2014
0 parents commit d505755
Show file tree
Hide file tree
Showing 18 changed files with 1,012 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules
50 changes: 50 additions & 0 deletions README.md
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.





87 changes: 87 additions & 0 deletions gulpfile.coffee
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']
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('coffee-script/register')
require('./gulpfile.coffee')
10 changes: 10 additions & 0 deletions index.html
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>
29 changes: 29 additions & 0 deletions package.json
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": {}
}
Binary file added resources/images/baddie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/diamond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/dude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/firstaid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/platform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/sky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d505755

Please sign in to comment.