Brand new Grunt task - creates each core library as its own file and a combined phaser.js.

New build script now cleanly splits Phaser, Pixi and p2 so they are each UMD wrapped and each available in the global scope (now more requireJS friendly!).
phaser-no-libs.js allows you to use your own version of p2.js or pixi.js with Phaser. Warning: This is totally unsupported. If you hit bugs, you fix them yourself.
Fixed silly instanceof bug in game objects (sorry guys).
This commit is contained in:
photonstorm
2014-02-28 09:30:53 +00:00
parent 4562939e4e
commit 8662cd2fd4
34 changed files with 28254 additions and 12603 deletions
+261 -321
View File
@@ -1,362 +1,302 @@
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadTasks('./tasks');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadTasks('./tasks');
grunt.initConfig({
compile_dir: 'dist',
src: {
phaser: [
'build/p2.js',
'src/Intro.js',
'src/pixi/Pixi.js',
'src/Phaser.js',
'src/utils/Utils.js',
grunt.initConfig({
'src/geom/Circle.js',
'src/geom/Point.js',
'src/geom/Rectangle.js',
'src/geom/Line.js',
'src/geom/Ellipse.js',
'src/geom/Polygon.js',
pkg: grunt.file.readJSON('package.json'),
'src/pixi/core/Matrix.js',
'src/pixi/display/DisplayObject.js',
'src/pixi/display/DisplayObjectContainer.js',
'src/pixi/display/Sprite.js',
'src/pixi/display/SpriteBatch.js',
'src/pixi/filters/FilterBlock.js',
'src/pixi/text/Text.js',
'src/pixi/text/BitmapText.js',
'src/pixi/display/Stage.js',
'src/pixi/utils/EventTarget.js',
'src/pixi/utils/Polyk.js',
'src/pixi/renderers/webgl/utils/WebGLShaderUtils.js',
'src/pixi/renderers/webgl/shaders/PixiShader.js',
'src/pixi/renderers/webgl/shaders/PixiFastShader.js',
'src/pixi/renderers/webgl/shaders/StripShader.js',
'src/pixi/renderers/webgl/shaders/PrimitiveShader.js',
'src/pixi/renderers/webgl/utils/WebGLGraphics.js',
'src/pixi/renderers/webgl/WebGLRenderer.js',
'src/pixi/renderers/webgl/utils/WebGLMaskManager.js',
'src/pixi/renderers/webgl/utils/WebGLShaderManager.js',
'src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js',
'src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js',
'src/pixi/renderers/webgl/utils/WebGLFilterManager.js',
'src/pixi/renderers/webgl/utils/FilterTexture.js',
'src/pixi/renderers/canvas/utils/CanvasMaskManager.js',
'src/pixi/renderers/canvas/utils/CanvasTinter.js',
'src/pixi/renderers/canvas/CanvasRenderer.js',
'src/pixi/renderers/canvas/CanvasGraphics.js',
'src/pixi/primitives/Graphics.js',
'src/pixi/extras/TilingSprite.js',
'src/pixi/textures/BaseTexture.js',
'src/pixi/textures/Texture.js',
'src/pixi/textures/RenderTexture.js',
banner: '/**\n' +
'* @author Richard Davey <rich@photonstorm.com>\n' +
'* @copyright 2014 Photon Storm Ltd.\n' +
'* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n' +
'*\n' +
'* @overview\n' +
'*\n' +
'* Phaser - http://www.phaser.io\n' +
'*\n' +
'* v<%= pkg.version %> "<%= pkg.release %>" - Built: <%= grunt.template.today() %>\n' +
'*\n' +
'* By Richard Davey http://www.photonstorm.com @photonstorm\n' +
'*\n' +
'* Phaser is a fun, free and fast 2D game framework for making HTML5 games \n' +
'* for desktop and mobile web browsers, supporting Canvas and WebGL rendering.\n' +
'*\n' +
'* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com @Doormat23\n' +
'* Phaser uses p2.js for physics, created by Stefan Hedman https://github.com/schteppe/p2.js @schteppe\n' +
'*\n' +
'* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from which both Phaser\n' +
'* and my love of framework development originate.\n' +
'*\n' +
'* Follow Phaser development progress at http://phaser.io\n' +
'*\n' +
'* "If you want your children to be intelligent, read them fairy tales."\n' +
'* "If you want them to be more intelligent, read them more fairy tales."\n' +
'* -- Albert Einstein\n' +
'*/\n',
'src/core/Camera.js',
'src/core/State.js',
'src/core/StateManager.js',
'src/core/LinkedList.js',
'src/core/Signal.js',
'src/core/SignalBinding.js',
'src/core/Filter.js',
'src/core/Plugin.js',
'src/core/PluginManager.js',
'src/core/Stage.js',
'src/core/Group.js',
'src/core/World.js',
'src/core/ScaleManager.js',
'src/core/Game.js',
compile_dir: 'dist',
'src/input/Input.js',
'src/input/Key.js',
'src/input/Keyboard.js',
'src/input/Mouse.js',
'src/input/MSPointer.js',
'src/input/Pointer.js',
'src/input/Touch.js',
'src/input/Gamepad.js',
'src/input/SinglePad.js',
'src/input/GamepadButton.js',
'src/input/InputHandler.js',
p2: [
'src/p2.js'
],
'src/gameobjects/Events.js',
'src/gameobjects/GameObjectFactory.js',
'src/gameobjects/GameObjectCreator.js',
'src/gameobjects/BitmapData.js',
'src/gameobjects/Sprite.js',
'src/gameobjects/Image.js',
'src/gameobjects/TileSprite.js',
'src/gameobjects/Text.js',
'src/gameobjects/BitmapText.js',
'src/gameobjects/Button.js',
'src/gameobjects/Graphics.js',
'src/gameobjects/RenderTexture.js',
'src/gameobjects/SpriteBatch.js',
'src/gameobjects/BitmapFont.js',
pixi: [
'src/pixi/Intro.js',
'src/pixi/Pixi.js',
'src/pixi/core/Point.js',
'src/pixi/core/Rectangle.js',
'src/pixi/core/Polygon.js',
'src/pixi/core/Circle.js',
'src/pixi/core/Ellipse.js',
'src/pixi/core/Matrix.js',
'src/pixi/display/DisplayObject.js',
'src/pixi/display/DisplayObjectContainer.js',
'src/pixi/display/Sprite.js',
'src/pixi/display/SpriteBatch.js',
'src/pixi/filters/FilterBlock.js',
'src/pixi/text/Text.js',
'src/pixi/text/BitmapText.js',
'src/pixi/display/Stage.js',
'src/pixi/utils/Utils.js',
'src/pixi/utils/EventTarget.js',
'src/pixi/utils/Polyk.js',
'src/pixi/renderers/webgl/utils/WebGLShaderUtils.js',
'src/pixi/renderers/webgl/shaders/PixiShader.js',
'src/pixi/renderers/webgl/shaders/PixiFastShader.js',
'src/pixi/renderers/webgl/shaders/StripShader.js',
'src/pixi/renderers/webgl/shaders/PrimitiveShader.js',
'src/pixi/renderers/webgl/utils/WebGLGraphics.js',
'src/pixi/renderers/webgl/WebGLRenderer.js',
'src/pixi/renderers/webgl/utils/WebGLMaskManager.js',
'src/pixi/renderers/webgl/utils/WebGLShaderManager.js',
'src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js',
'src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js',
'src/pixi/renderers/webgl/utils/WebGLFilterManager.js',
'src/pixi/renderers/webgl/utils/FilterTexture.js',
'src/pixi/renderers/canvas/utils/CanvasMaskManager.js',
'src/pixi/renderers/canvas/utils/CanvasTinter.js',
'src/pixi/renderers/canvas/CanvasRenderer.js',
'src/pixi/renderers/canvas/CanvasGraphics.js',
'src/pixi/primitives/Graphics.js',
'src/pixi/extras/TilingSprite.js',
'src/pixi/textures/BaseTexture.js',
'src/pixi/textures/Texture.js',
'src/pixi/textures/RenderTexture.js',
'src/pixi/Outro.js',
],
'src/system/Canvas.js',
'src/system/Device.js',
'src/system/RequestAnimationFrame.js',
phaser: [
'src/Intro.js',
'src/Phaser.js',
'src/utils/Utils.js',
'src/math/Math.js',
'src/math/RandomDataGenerator.js',
'src/geom/Circle.js',
'src/geom/Point.js',
'src/geom/Rectangle.js',
'src/geom/Line.js',
'src/geom/Ellipse.js',
'src/geom/Polygon.js',
'src/net/Net.js',
'src/core/Camera.js',
'src/core/State.js',
'src/core/StateManager.js',
'src/core/LinkedList.js',
'src/core/Signal.js',
'src/core/SignalBinding.js',
'src/core/Filter.js',
'src/core/Plugin.js',
'src/core/PluginManager.js',
'src/core/Stage.js',
'src/core/Group.js',
'src/core/World.js',
'src/core/ScaleManager.js',
'src/core/Game.js',
'src/tween/TweenManager.js',
'src/tween/Tween.js',
'src/tween/Easing.js',
'src/input/Input.js',
'src/input/Key.js',
'src/input/Keyboard.js',
'src/input/Mouse.js',
'src/input/MSPointer.js',
'src/input/Pointer.js',
'src/input/Touch.js',
'src/input/Gamepad.js',
'src/input/SinglePad.js',
'src/input/GamepadButton.js',
'src/input/InputHandler.js',
'src/time/Time.js',
'src/time/Timer.js',
'src/time/TimerEvent.js',
'src/gameobjects/Events.js',
'src/gameobjects/GameObjectFactory.js',
'src/gameobjects/GameObjectCreator.js',
'src/gameobjects/BitmapData.js',
'src/gameobjects/Sprite.js',
'src/gameobjects/Image.js',
'src/gameobjects/TileSprite.js',
'src/gameobjects/Text.js',
'src/gameobjects/BitmapText.js',
'src/gameobjects/Button.js',
'src/gameobjects/Graphics.js',
'src/gameobjects/RenderTexture.js',
'src/gameobjects/SpriteBatch.js',
'src/gameobjects/BitmapFont.js',
'src/animation/AnimationManager.js',
'src/animation/Animation.js',
'src/animation/Frame.js',
'src/animation/FrameData.js',
'src/animation/AnimationParser.js',
'src/system/Canvas.js',
'src/system/Device.js',
'src/system/RequestAnimationFrame.js',
'src/loader/Cache.js',
'src/loader/Loader.js',
'src/loader/LoaderParser.js',
'src/math/Math.js',
'src/math/RandomDataGenerator.js',
'src/sound/Sound.js',
'src/sound/SoundManager.js',
'src/net/Net.js',
'src/utils/Debug.js',
'src/utils/Color.js',
'src/tween/TweenManager.js',
'src/tween/Tween.js',
'src/tween/Easing.js',
'src/physics/World.js',
'src/physics/PointProxy.js',
'src/physics/InversePointProxy.js',
'src/physics/Body.js',
'src/physics/Spring.js',
'src/physics/Material.js',
'src/physics/ContactMaterial.js',
'src/physics/CollisionGroup.js',
'src/time/Time.js',
'src/time/Timer.js',
'src/time/TimerEvent.js',
'src/particles/Particles.js',
'src/particles/arcade/ArcadeParticles.js',
'src/particles/arcade/Emitter.js',
'src/animation/AnimationManager.js',
'src/animation/Animation.js',
'src/animation/Frame.js',
'src/animation/FrameData.js',
'src/animation/AnimationParser.js',
'src/tilemap/Tile.js',
'src/tilemap/Tilemap.js',
'src/tilemap/TilemapLayer.js',
'src/tilemap/TilemapParser.js',
'src/tilemap/Tileset.js'
],
phaserNoPhysics: [
'src/Intro.js',
'src/pixi/Pixi.js',
'src/Phaser.js',
'src/utils/Utils.js',
'src/loader/Cache.js',
'src/loader/Loader.js',
'src/loader/LoaderParser.js',
'src/geom/Circle.js',
'src/geom/Point.js',
'src/geom/Rectangle.js',
'src/geom/Line.js',
'src/geom/Ellipse.js',
'src/geom/Polygon.js',
'src/sound/Sound.js',
'src/sound/SoundManager.js',
'src/pixi/core/Matrix.js',
'src/pixi/display/DisplayObject.js',
'src/pixi/display/DisplayObjectContainer.js',
'src/pixi/display/Sprite.js',
'src/pixi/display/SpriteBatch.js',
'src/pixi/filters/FilterBlock.js',
'src/pixi/text/Text.js',
'src/pixi/text/BitmapText.js',
'src/pixi/display/Stage.js',
'src/pixi/utils/EventTarget.js',
'src/pixi/utils/Polyk.js',
'src/pixi/renderers/webgl/utils/WebGLShaderUtils.js',
'src/pixi/renderers/webgl/shaders/PixiShader.js',
'src/pixi/renderers/webgl/shaders/PixiFastShader.js',
'src/pixi/renderers/webgl/shaders/StripShader.js',
'src/pixi/renderers/webgl/shaders/PrimitiveShader.js',
'src/pixi/renderers/webgl/utils/WebGLGraphics.js',
'src/pixi/renderers/webgl/WebGLRenderer.js',
'src/pixi/renderers/webgl/utils/WebGLMaskManager.js',
'src/pixi/renderers/webgl/utils/WebGLShaderManager.js',
'src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js',
'src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js',
'src/pixi/renderers/webgl/utils/WebGLFilterManager.js',
'src/pixi/renderers/webgl/utils/FilterTexture.js',
'src/pixi/renderers/canvas/utils/CanvasMaskManager.js',
'src/pixi/renderers/canvas/utils/CanvasTinter.js',
'src/pixi/renderers/canvas/CanvasRenderer.js',
'src/pixi/renderers/canvas/CanvasGraphics.js',
'src/pixi/primitives/Graphics.js',
'src/pixi/extras/TilingSprite.js',
'src/pixi/textures/BaseTexture.js',
'src/pixi/textures/Texture.js',
'src/pixi/textures/RenderTexture.js',
'src/utils/Debug.js',
'src/utils/Color.js',
'src/core/Camera.js',
'src/core/State.js',
'src/core/StateManager.js',
'src/core/LinkedList.js',
'src/core/Signal.js',
'src/core/SignalBinding.js',
'src/core/Filter.js',
'src/core/Plugin.js',
'src/core/PluginManager.js',
'src/core/Stage.js',
'src/core/Group.js',
'src/core/World.js',
'src/core/ScaleManager.js',
'src/core/GameNoPhysics.js',
'src/physics/World.js',
'src/physics/PointProxy.js',
'src/physics/InversePointProxy.js',
'src/physics/Body.js',
'src/physics/Spring.js',
'src/physics/Material.js',
'src/physics/ContactMaterial.js',
'src/physics/CollisionGroup.js',
'src/input/Input.js',
'src/input/Key.js',
'src/input/Keyboard.js',
'src/input/Mouse.js',
'src/input/MSPointer.js',
'src/input/Pointer.js',
'src/input/Touch.js',
'src/input/Gamepad.js',
'src/input/SinglePad.js',
'src/input/GamepadButton.js',
'src/input/InputHandler.js',
'src/particles/Particles.js',
'src/particles/arcade/ArcadeParticles.js',
'src/particles/arcade/Emitter.js',
'src/gameobjects/Events.js',
'src/gameobjects/GameObjectFactory.js',
'src/gameobjects/GameObjectCreator.js',
'src/gameobjects/BitmapData.js',
'src/gameobjects/Sprite.js',
'src/gameobjects/Image.js',
'src/gameobjects/TileSprite.js',
'src/gameobjects/Text.js',
'src/gameobjects/BitmapText.js',
'src/gameobjects/Button.js',
'src/gameobjects/Graphics.js',
'src/gameobjects/RenderTexture.js',
'src/gameobjects/SpriteBatch.js',
'src/gameobjects/BitmapFont.js',
'src/tilemap/Tile.js',
'src/tilemap/Tilemap.js',
'src/tilemap/TilemapLayer.js',
'src/tilemap/TilemapParser.js',
'src/tilemap/Tileset.js',
'src/system/Canvas.js',
'src/system/Device.js',
'src/system/RequestAnimationFrame.js',
'src/Outro.js'
],
'src/math/Math.js',
'src/math/RandomDataGenerator.js',
clean: ['<%= compile_dir %>'],
'src/net/Net.js',
concat: {
'src/tween/TweenManager.js',
'src/tween/Tween.js',
'src/tween/Easing.js',
// Our custom version of p2
p2: {
src: ['<%= p2 %>'],
dest: '<%= compile_dir %>/p2.js'
},
'src/time/Time.js',
'src/time/Timer.js',
'src/time/TimerEvent.js',
// Our custom version of Pixi
pixi: {
src: ['<%= pixi %>'],
dest: '<%= compile_dir %>/pixi.js'
},
'src/animation/AnimationManager.js',
'src/animation/Animation.js',
'src/animation/Frame.js',
'src/animation/FrameData.js',
'src/animation/AnimationParser.js',
// Phaser, stand-alone (no bundled libs)
phaser: {
options: {
banner: '<%= banner %>'
},
src: ['<%= phaser %>'],
dest: '<%= compile_dir %>/phaser-no-libs.js'
},
'src/loader/Cache.js',
'src/loader/Loader.js',
'src/loader/LoaderParser.js',
'src/sound/Sound.js',
'src/sound/SoundManager.js',
'src/utils/Debug.js',
'src/utils/Color.js',
'src/tilemap/Tile.js',
'src/tilemap/Tilemap.js',
'src/tilemap/TilemapLayer.js',
'src/tilemap/TilemapParser.js',
'src/tilemap/Tileset.js'
]
},
pkg: grunt.file.readJSON('package.json'),
clean: ['<%= compile_dir %>'],
concat: {
phaser: {
options: {
process: {
data: {
version: '<%= pkg.version %>',
buildDate: '<%= grunt.template.today() %>'
// One ring to rule them all
standalone: {
options: {
banner: '<%= banner %>'
},
src: ['<%= compile_dir %>/p2.js', '<%= compile_dir %>/pixi.js', '<%= compile_dir %>/phaser-no-libs.js'],
dest: '<%= compile_dir %>/phaser.js'
}
}
},
src: ['<%= src.phaser %>'],
dest: '<%= compile_dir %>/phaser.js'
},
phaserNoPhysics: {
options: {
process: {
data: {
version: '<%= pkg.version %>.np',
buildDate: '<%= grunt.template.today() %>'
uglify: {
p2: {
options: {
banner: '/* p2.js custom build for Phaser v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.p2.dest %>'],
dest: '<%= compile_dir %>/p2.min.js'
},
pixi: {
options: {
banner: '/* Pixi.js custom build for Phaser v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.pixi.dest %>'],
dest: '<%= compile_dir %>/pixi.min.js'
},
phaser: {
options: {
banner: '/* Phaser (no libs) v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.phaser.dest %>'],
dest: '<%= compile_dir %>/phaser-no-libs.min.js'
},
standalone: {
options: {
sourceMap: true,
sourceMapName: '<%= compile_dir %>/phaser.map',
banner: '/* Phaser v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.standalone.dest %>'],
dest: '<%= compile_dir %>/phaser.min.js'
}
}
},
src: ['<%= src.phaserNoPhysics %>'],
dest: '<%= compile_dir %>/phaserNoPhysics.js'
}
},
umd: {
phaser: {
src: '<%= concat.phaser.dest %>',
dest: '<%= umd.phaser.src %>'
},
phaserNoPhysics: {
src: '<%= concat.phaserNoPhysics.dest %>',
dest: '<%= umd.phaserNoPhysics.src %>'
}
},
uglify: {
phaser: {
options: {
banner: '/*! Phaser v<%= pkg.version %> | (c) 2014 Photon Storm Ltd. */\n'
examples: {
all: {
options: {
base: 'examples',
excludes: ['_site', 'assets', 'states', 'wip']
},
src: ['examples/**/*.js'],
dest: 'examples/_site/examples.json'
}
},
src: ['<%= umd.phaser.dest %>'],
dest: '<%= compile_dir %>/phaser.min.js'
},
phaserNoPhysics: {
options: {
banner: '/*! Phaser v<%= pkg.version %>.np | (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= umd.phaserNoPhysics.dest %>'],
dest: '<%= compile_dir %>/phaserNoPhysics.min.js'
}
},
examples: {
all: {
options: {
base: 'examples',
excludes: ['_site', 'assets', 'states', 'wip']
},
src: ['examples/**/*.js'],
dest: 'examples/_site/examples.json'
}
},
connect: {
root: {
options: {
keepalive: true,
hostname: '*'
connect: {
root: {
options: {
keepalive: true,
hostname: '*'
}
}
}
}
}
});
grunt.registerTask('default', ['build', 'examples']);
grunt.registerTask('build', ['clean', 'concat', 'umd', 'uglify']);
grunt.registerTask('noUmd', ['clean', 'concat', 'uglify']);
});
grunt.registerTask('default', ['build', 'examples']);
grunt.registerTask('build', ['clean', 'concat', 'uglify']);
};
+3 -2
View File
@@ -125,6 +125,9 @@ New features:
* All GameObjects now have a 'destroyChildren' boolean as a parameter to their destroy method. It's default is true and the value propogates down its children.
* Pixi GrayFilter ported over (thanks nickryall #404)
* Animation.speed added. You can now change the animation speed on the fly, without re-starting the animation (feature request #458)
* Brand new Grunt task - creates each core library as its own file and a combined phaser.js.
* New build script now cleanly splits Phaser, Pixi and p2 so they are each UMD wrapped and each available in the global scope (now more requireJS friendly!).
* phaser-no-libs.js allows you to use your own version of p2.js or pixi.js with Phaser. Warning: This is totally unsupported. If you hit bugs, you fix them yourself.
Updates:
@@ -148,8 +151,6 @@ Updates:
* Vastly improved visibility API support + pageshow/pagehide + focus/blur. Working across Chrome, IE, Firefox, iOS, Android (also fixes #161)
* Pausing the game will now mute audio and resuming will un-mute, unless it was muted via the game (fixes #439)
* ScaleManager has 2 new events: ScaleManager.enterFullScreen and ScaleManager.leaveFullScreen, so you can respond to fullscreen changes directly.
* The grunt task now creates an optional version of Phaser without any Physics support built in. Quite a bit smaller now.
* The grunt task now has a new `noUmd` option which builds Phaser without the UMD wrapper.
Bug Fixes:
+19 -64
View File
@@ -1,75 +1,19 @@
<?php
// All JS files in build order.
// Much easier for debugging re: line numbers
if (!isset($path))
{
$path = '..';
}
/*
<script src="$path/src/pixi/InteractionData.js"></script>
<script src="$path/src/pixi/InteractionManager.js"></script>
<script src="$path/src/pixi/loaders/AssetLoader.js"></script>
<script src="$path/src/pixi/loaders/JsonLoader.js"></script>
<script src="$path/src/pixi/loaders/AtlasLoader.js"></script>
<script src="$path/src/pixi/loaders/SpriteSheetLoader.js"></script>
<script src="$path/src/pixi/loaders/ImageLoader.js"></script>
<script src="$path/src/pixi/loaders/BitmapFontLoader.js"></script>
<script src="$path/src/pixi/loaders/SpineLoader.js"></script>
<script src="$path/src/pixi/filters/AbstractFilter.js"></script>
<script src="$path/src/pixi/filters/AlphaMaskFilter.js"></script>
<script src="$path/src/pixi/filters/ColorMatrixFilter.js"></script>
<script src="$path/src/pixi/filters/GrayFilter.js"></script>
<script src="$path/src/pixi/filters/DisplacementFilter.js"></script>
<script src="$path/src/pixi/filters/PixelateFilter.js"></script>
<script src="$path/src/pixi/filters/BlurXFilter.js"></script>
<script src="$path/src/pixi/filters/BlurYFilter.js"></script>
<script src="$path/src/pixi/filters/BlurFilter.js"></script>
<script src="$path/src/pixi/filters/InvertFilter.js"></script>
<script src="$path/src/pixi/filters/SepiaFilter.js"></script>
<script src="$path/src/pixi/filters/TwistFilter.js"></script>
<script src="$path/src/pixi/filters/ColorStepFilter.js"></script>
<script src="$path/src/pixi/filters/DotScreenFilter.js"></script>
<script src="$path/src/pixi/filters/CrossHatchFilter.js"></script>
<script src="$path/src/pixi/filters/RGBSplitFilter.js"></script>
<script src="$path/src/pixi/extras/Spine.js"></script>
<script src="$path/src/pixi/extras/Strip.js"></script>
<script src="$path/src/pixi/extras/Rope.js"></script>
<script src="$path/src/pixi/display/MovieClip.js"></script>
<script src="$path/src/pixi/utils/Utils.js"></script>
<script src="$path/src/pixi/core/Point.js"></script>
<script src="$path/src/pixi/core/Rectangle.js"></script>
<script src="$path/src/pixi/core/Circle.js"></script>
<script src="$path/src/pixi/utils/Detector.js"></script>
<script src="$path/src/physics/arcade/SAT.js"></script>
<script src="$path/src/physics/arcade/ArcadePhysics.js"></script>
<script src="$path/src/physics/arcade/Body.js"></script>
*/
echo <<<EOL
<script src="$path/build/p2.js"></script>
<script src="$path/src/Intro.js"></script>
<script src="$path/src/p2.js"></script>
<script src="$path/src/pixi/Pixi.js"></script>
<script src="$path/src/Phaser.js"></script>
<script src="$path/src/utils/Utils.js"></script>
<script src="$path/src/geom/Circle.js"></script>
<script src="$path/src/geom/Point.js"></script>
<script src="$path/src/geom/Rectangle.js"></script>
<script src="$path/src/geom/Line.js"></script>
<script src="$path/src/geom/Ellipse.js"></script>
<script src="$path/src/geom/Polygon.js"></script>
<script src="$path/src/pixi/core/Point.js"></script>
<script src="$path/src/pixi/core/Rectangle.js"></script>
<script src="$path/src/pixi/core/Polygon.js"></script>
<script src="$path/src/pixi/core/Circle.js"></script>
<script src="$path/src/pixi/core/Ellipse.js"></script>
<script src="$path/src/pixi/core/Matrix.js"></script>
<script src="$path/src/pixi/display/DisplayObject.js"></script>
<script src="$path/src/pixi/display/DisplayObjectContainer.js"></script>
@@ -79,6 +23,7 @@
<script src="$path/src/pixi/text/Text.js"></script>
<script src="$path/src/pixi/text/BitmapText.js"></script>
<script src="$path/src/pixi/display/Stage.js"></script>
<script src="$path/src/pixi/utils/Utils.js"></script>
<script src="$path/src/pixi/utils/EventTarget.js"></script>
<script src="$path/src/pixi/utils/Polyk.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js"></script>
@@ -104,6 +49,16 @@
<script src="$path/src/pixi/textures/Texture.js"></script>
<script src="$path/src/pixi/textures/RenderTexture.js"></script>
<script src="$path/src/Phaser.js"></script>
<script src="$path/src/utils/Utils.js"></script>
<script src="$path/src/geom/Circle.js"></script>
<script src="$path/src/geom/Point.js"></script>
<script src="$path/src/geom/Rectangle.js"></script>
<script src="$path/src/geom/Line.js"></script>
<script src="$path/src/geom/Ellipse.js"></script>
<script src="$path/src/geom/Polygon.js"></script>
<script src="$path/src/core/Camera.js"></script>
<script src="$path/src/core/State.js"></script>
<script src="$path/src/core/StateManager.js"></script>
@@ -198,4 +153,4 @@
<script src="$path/src/tilemap/TilemapParser.js"></script>
<script src="$path/src/tilemap/Tileset.js"></script>
EOL;
?>
?>
View File
+5
View File
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+9590
View File
File diff suppressed because it is too large Load Diff
+4
View File
File diff suppressed because one or more lines are too long
+3638 -2881
View File
File diff suppressed because it is too large Load Diff
+1
View File
File diff suppressed because one or more lines are too long
+19 -17
View File
File diff suppressed because one or more lines are too long
-13
View File
File diff suppressed because one or more lines are too long
-133
View File
@@ -1,133 +0,0 @@
<?php
// Global
// $files = dirToArray(dirname(__FILE__));
$files = dirToArray('../');
$total = 0;
foreach ($files as $key => $value)
{
if (is_array($value) && count($value) > 0)
{
$total += count($value);
}
}
function getFile() {
global $files, $dir, $filename, $title, $code;
if (isset($_GET['d']) && isset($_GET['f']))
{
$dir = urldecode($_GET['d']);
$filename = urldecode($_GET['d']) . '/' . urldecode($_GET['f']);
$title = urldecode($_GET['t']);
if (file_exists($filename))
{
$code = file_get_contents($filename);
$files = dirToArray($dir);
}
}
}
function dirToArray($dir) {
$ignore = array('.', '..', '_site', 'assets', 'states', 'wip', 'games', 'basics');
$result = array();
$root = scandir($dir);
$dirs = array_diff($root, $ignore);
// We want these 2 to appear top of the list
array_unshift($dirs, 'basics', 'games');
foreach ($dirs as $key => $value)
{
if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
{
$result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
}
else
{
if (substr($value, -3) == '.js')
{
$result[] = $value;
}
}
}
return $result;
}
function printJSLinks($dir, $files, $target) {
$output = "";
foreach ($files as $key => $value)
{
$value2 = substr($value, 0, -3);
$dir = urlencode($dir);
$file = urlencode($value);
$title = urlencode($value2);
if ($target == 'viewer')
{
$output .= " <a href=\"view_lite.php?d=$dir&amp;f=$file&amp;t=$title\" target=\"viewer\">$value2</a></br>\n";
}
else if ($target == 'json')
{
$output .= " { \"file\": \"$file\", \"title\": \"$value2\" },\n";
}
else
{
$output .= " <li><a href=\"view_full.php?d=$dir&amp;f=$file&amp;t=$title\">$value2</a></li>\n";
}
}
if ($target == 'json')
{
$output = rtrim($output);
$output = substr($output, 0, -1);
$output .= "\n";
}
return $output;
}
?>
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>Phaser Examples JSON Build Script</title>
</head>
<body>
<textarea style="width: 800px; height: 800px">
<?php
$output = "{\n";
foreach ($files as $key => $value)
{
if (is_array($value) && count($value) > 0)
{
$output .= "\"$key\": [\n";
$output .= printJSLinks($key, $value, 'json');
$output .= "],\n";
}
}
$output = rtrim($output);
$output = substr($output, 0, -1);
$output .= "\n}";
echo $output;
file_put_contents('examples.json', $output);
?>
</textarea>
</body>
</html>
+1 -1
View File
@@ -58,7 +58,7 @@ $(document).ready(function(){
.done(function(data) {
if (data.version !== '1.1.4')
if (data.version !== '2.0.0')
{
$("#upgrade").append(data.version);
$("#upgrade").css('display', 'inline-block');
+21 -15
View File
@@ -10,21 +10,16 @@
<!--
If you're wondering why we embed each script separately, and not just the single-file phaser lib
it's because it makes debugging *significantly* easier for us. Feel free to replace all the below
with just a call to ../dist/phaser.js instead if you prefer.
with just a call to ../build/phaser.js instead if you prefer.
-->
<script src="../build/p2.js"></script>
<script src="../src/Intro.js"></script>
<script src="../src/p2.js"></script>
<script src="../src/pixi/Pixi.js"></script>
<script src="../src/Phaser.js"></script>
<script src="../src/utils/Utils.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/geom/Line.js"></script>
<script src="../src/geom/Ellipse.js"></script>
<script src="../src/geom/Polygon.js"></script>
<script src="../src/pixi/core/Point.js"></script>
<script src="../src/pixi/core/Rectangle.js"></script>
<script src="../src/pixi/core/Polygon.js"></script>
<script src="../src/pixi/core/Circle.js"></script>
<script src="../src/pixi/core/Ellipse.js"></script>
<script src="../src/pixi/core/Matrix.js"></script>
<script src="../src/pixi/display/DisplayObject.js"></script>
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
@@ -34,6 +29,7 @@
<script src="../src/pixi/text/Text.js"></script>
<script src="../src/pixi/text/BitmapText.js"></script>
<script src="../src/pixi/display/Stage.js"></script>
<script src="../src/pixi/utils/Utils.js"></script>
<script src="../src/pixi/utils/EventTarget.js"></script>
<script src="../src/pixi/utils/Polyk.js"></script>
<script src="../src/pixi/renderers/webgl/utils/WebGLShaderUtils.js"></script>
@@ -59,6 +55,16 @@
<script src="../src/pixi/textures/Texture.js"></script>
<script src="../src/pixi/textures/RenderTexture.js"></script>
<script src="../src/Phaser.js"></script>
<script src="../src/utils/Utils.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/geom/Line.js"></script>
<script src="../src/geom/Ellipse.js"></script>
<script src="../src/geom/Polygon.js"></script>
<script src="../src/core/Camera.js"></script>
<script src="../src/core/State.js"></script>
<script src="../src/core/StateManager.js"></script>
@@ -71,8 +77,8 @@
<script src="../src/core/Stage.js"></script>
<script src="../src/core/Group.js"></script>
<script src="../src/core/World.js"></script>
<script src="../src/core/ScaleManager.js"></script>
<script src="../src/core/Game.js"></script>
<script src="../src/core/ScaleManager.js"></script>
<script src="../src/input/Input.js"></script>
<script src="../src/input/Key.js"></script>
@@ -163,7 +169,7 @@
<div class="header">
<div class="box100 no-padding">
<div class="phaser-version">
<span>Phaser Version: 1.2</span>
<span>Phaser Version: 2.0.0</span>
<a id="upgrade" href="https://github.com/photonstorm/phaser" class="version-button">New version: </a>
</div>
</div>
+19 -13
View File
@@ -12,19 +12,14 @@
it's because it makes debugging *significantly* easier for us. Feel free to replace all the below
with just a call to ../build/phaser.js instead if you prefer.
-->
<script src="../build/p2.js"></script>
<script src="../src/Intro.js"></script>
<script src="../src/p2.js"></script>
<script src="../src/pixi/Pixi.js"></script>
<script src="../src/Phaser.js"></script>
<script src="../src/utils/Utils.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/geom/Line.js"></script>
<script src="../src/geom/Ellipse.js"></script>
<script src="../src/geom/Polygon.js"></script>
<script src="../src/pixi/core/Point.js"></script>
<script src="../src/pixi/core/Rectangle.js"></script>
<script src="../src/pixi/core/Polygon.js"></script>
<script src="../src/pixi/core/Circle.js"></script>
<script src="../src/pixi/core/Ellipse.js"></script>
<script src="../src/pixi/core/Matrix.js"></script>
<script src="../src/pixi/display/DisplayObject.js"></script>
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
@@ -34,6 +29,7 @@
<script src="../src/pixi/text/Text.js"></script>
<script src="../src/pixi/text/BitmapText.js"></script>
<script src="../src/pixi/display/Stage.js"></script>
<script src="../src/pixi/utils/Utils.js"></script>
<script src="../src/pixi/utils/EventTarget.js"></script>
<script src="../src/pixi/utils/Polyk.js"></script>
<script src="../src/pixi/renderers/webgl/utils/WebGLShaderUtils.js"></script>
@@ -59,6 +55,16 @@
<script src="../src/pixi/textures/Texture.js"></script>
<script src="../src/pixi/textures/RenderTexture.js"></script>
<script src="../src/Phaser.js"></script>
<script src="../src/utils/Utils.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/geom/Line.js"></script>
<script src="../src/geom/Ellipse.js"></script>
<script src="../src/geom/Polygon.js"></script>
<script src="../src/core/Camera.js"></script>
<script src="../src/core/State.js"></script>
<script src="../src/core/StateManager.js"></script>
@@ -71,8 +77,8 @@
<script src="../src/core/Stage.js"></script>
<script src="../src/core/Group.js"></script>
<script src="../src/core/World.js"></script>
<script src="../src/core/ScaleManager.js"></script>
<script src="../src/core/Game.js"></script>
<script src="../src/core/ScaleManager.js"></script>
<script src="../src/input/Input.js"></script>
<script src="../src/input/Key.js"></script>
+1 -1
View File
@@ -12,7 +12,7 @@
<div class="header">
<div class="box100 no-padding">
<div class="phaser-version">
<span>Phaser Version: 1.2</span>
<span>Phaser Version: 2.0.0</span>
<a id="upgrade" href="https://github.com/photonstorm/phaser" class="version-button">New version: </a>
</div>
</div>
+1 -1
View File
@@ -19,7 +19,7 @@
</div>
<div id="footer">
<p id="total">Total examples: </p>
<p>Phaser version: 1.2</p>
<p>Phaser version: 2.0.0</p>
<p><a href="index.html">Switch to Full View</a></p>
</div>
@@ -6,7 +6,7 @@
<title>phaser</title>
<base href="../" />
<script src="_site/js/jquery-2.0.3.min.js" type="text/javascript"></script>
<script src="../build/phaser.js" type="text/javascript"></script>
<script src="../dist/phaser.js" type="text/javascript"></script>
<?php
if (isset($_GET['f']))
{
@@ -27,5 +27,7 @@
<div id="phaser-example"></div>
<p><a href="wip/index.php">Back to index</a></p>
</body>
</html>
+5 -7
View File
@@ -64,7 +64,10 @@
$value2 = substr($value, 0, -3);
$file = urlencode($value);
$output .= "<tr><td><a href=\"wip/index.php?f=$file\">$value2</a></td><td><a href=\"wip/index-fs.php?f=$file\">(full screen)</a></td><td><a href=\"wip/index-cocoon.php?f=$file\">(cocoon)</a></td></tr>";
$output .= "<tr><td><a href=\"wip/index.php?f=$file\">$value2</a></td>";
$output .= "<td><a href=\"wip/index-lib.php?f=$file\">[ single lib ]</a></td>";
$output .= "<td><a href=\"wip/index-fs.php?f=$file\">[ full screen ]</a></td>";
$output .= "<td><a href=\"wip/index-cocoon.php?f=$file\">[ cocoon ]</a></td></tr>";
}
return $output;
@@ -103,14 +106,9 @@
<div id="phaser-example"></div>
<input type="button" id="step" value="step" />
<input type="button" id="start" value="start" style="margin-left: 32px" />
<div style="padding: 32px">
<h2>work in progress examples</h2>
<table>
<table cellpadding="8">
<?php
echo printJSLinks('wip', $files);
?>
+136
View File
@@ -0,0 +1,136 @@
<?php
// Global
$files = dirToArray(dirname(__FILE__));
$total = 0;
foreach ($files as $key => $value)
{
if (is_array($value) && count($value) > 0)
{
$total += count($value);
}
}
function getFile() {
global $files, $dir, $filename, $title, $code;
if (isset($_GET['d']) && isset($_GET['f']))
{
$dir = urldecode($_GET['d']);
$filename = urldecode($_GET['d']) . '/' . urldecode($_GET['f']);
$title = urldecode($_GET['t']);
if (file_exists($filename))
{
$code = file_get_contents($filename);
$files = dirToArray($dir);
}
}
}
function dirToArray($dir) {
$ignore = array('.', '..', '_site', 'assets', 'gfx', 'states', 'book', 'filters', 'misc');
$result = array();
$root = scandir($dir);
$dirs = array_diff($root, $ignore);
foreach ($dirs as $key => $value)
{
if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
{
$result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
}
else
{
if (substr($value, -3) == '.js')
{
$result[] = $value;
}
}
}
return $result;
}
function printJSLinks($dir, $files) {
$output = "";
foreach ($files as $key => $value)
{
$value2 = substr($value, 0, -3);
$file = urlencode($value);
$output .= "<a href=\"wip/index.php?f=$file\">$value2</a><br />";
}
return $output;
}
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1 maximum-scale=1 user-scalable=0 minimal-ui" />
<title>phaser</title>
<base href="../" />
<script src="_site/js/jquery-2.0.3.min.js" type="text/javascript"></script>
<?php
require('../../build/config.php');
if (isset($_GET['f']))
{
$f = $_GET['f'];
?>
<script src="wip/<?php echo $f?>" type="text/javascript"></script>
<?php
}
?>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial;
font-size: 14px;
}
#phaser-example {
position: absolute;
top: 0;
left: 0;
}
</style>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ullamcorper ornare sagittis. Donec eleifend pulvinar velit nec convallis. Vestibulum vitae elit dui. Donec eu tincidunt sem. Duis lectus mi, bibendum sed nunc lobortis, tincidunt sollicitudin lectus. Aliquam erat volutpat. Aliquam a lectus sed tellus sodales tempus. Suspendisse potenti. Phasellus augue nisl, placerat vel sem vel, suscipit elementum neque. Vivamus tempor vestibulum eros, vitae mattis lectus aliquet ut. Curabitur interdum, nibh quis molestie placerat, augue ipsum commodo tortor, sed blandit est augue sit amet sapien. Ut vel consequat tellus. Aenean et vulputate sapien. Praesent rutrum elementum elit ut tempor. Aliquam erat volutpat. Fusce fermentum tincidunt est non vulputate.</p>
<p>In aliquam sed nulla id luctus. Donec ut nibh massa. Nullam aliquam feugiat urna, nec ultricies risus vulputate at. Fusce scelerisque ligula vel urna porta, nec aliquam leo facilisis. Duis accumsan nibh vestibulum, venenatis enim sit amet, condimentum sapien. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut auctor diam id mi porta, vestibulum pulvinar nibh sollicitudin. Curabitur ullamcorper lorem id lorem commodo, non ornare enim placerat. In vitae nisl lectus. Pellentesque eget neque sed ligula blandit porttitor vitae ut nibh. Nulla facilisi. Nunc ac erat viverra leo bibendum volutpat ut eu justo. Fusce a mollis purus. Phasellus consectetur vehicula ligula vel vestibulum. Suspendisse at dui vel ligula convallis lobortis at et tellus.</p>
<p>Nullam aliquam erat eros, sit amet faucibus tortor iaculis ut. Sed ullamcorper dui sed dolor rutrum tincidunt. Ut sed faucibus mauris, non porta tellus. Nam ultricies vel leo eget rutrum. Sed sit amet pretium risus. Nunc ut sapien eget elit ultrices pretium quis sed justo. Donec a est vitae justo vestibulum porta. Ut interdum pharetra quam id tempor. Sed egestas placerat quam, quis ullamcorper dolor ornare non. Nulla et porttitor neque, a congue nisl. Maecenas vitae elit pretium odio euismod rhoncus. Nulla turpis libero, fermentum quis aliquet et, ultrices nec mi.</p>
<p>Etiam vulputate, elit eu aliquet sagittis, sapien mi cursus nisi, vel mattis orci tortor non velit. Integer nisi dolor, posuere nec elit vitae, porttitor semper velit. Suspendisse sapien augue, lobortis sit amet dolor at, ornare porttitor metus. Proin venenatis ante nec augue volutpat dapibus. Sed interdum augue urna, id feugiat metus feugiat nec. In sed massa nisi. Donec iaculis nisi nulla, a pulvinar nisi dictum tristique. Nunc non erat enim. Proin consequat dolor nec leo gravida aliquet. Nulla non mollis turpis. Curabitur mollis tortor id elementum molestie. Maecenas eleifend et quam eget pellentesque.</p>
<p>Integer ac hendrerit lorem. Nulla laoreet enim eget sem placerat, quis sagittis augue egestas. Ut porttitor purus rhoncus arcu dictum, id condimentum eros fringilla. Donec odio odio, lacinia sed ligula sit amet, viverra scelerisque libero. Curabitur pellentesque nulla mattis, egestas nibh non, viverra eros. Nullam volutpat lectus erat, quis luctus dui lobortis sit amet. Aenean ornare at sem vel pretium. Sed eu euismod nibh. Donec sed venenatis tortor.</p>
<div id="phaser-example"></div>
<input type="button" id="step" value="step" />
<input type="button" id="start" value="start" style="margin-left: 32px" />
<div style="padding: 32px">
<h2>work in progress examples</h2>
<?php
echo printJSLinks('wip', $files);
?>
</div>
</body>
</html>
+2 -1
View File
@@ -1,6 +1,7 @@
{
"name": "Phaser",
"version": "2.0.0",
"release": "Aes Sedai",
"description": "A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.",
"author": "Richard Davey",
"logo": "https://raw.github.com/photonstorm/phaser/master/phaser-logo-small.png",
@@ -30,7 +31,7 @@
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-uglify": "~0.3.3",
"lodash": "~2.2.1"
}
}
+3 -23
View File
@@ -4,26 +4,6 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @overview
*
* Phaser - http://www.phaser.io
*
* v<%= version %> - Built at: <%= buildDate %>
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
* A feature-packed 2D HTML5 game framework born from the smouldering pits of Flixel and
* constructed via plenty of blood, sweat, tears and coffee by Richard Davey (@photonstorm).
*
* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com/ @Doormat23.
*
* Follow Phaser development progress at http://www.photonstorm.com
*
* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from which both Phaser
* and my love of game development originate.
*
* "If you want your children to be intelligent, read them fairy tales."
* "If you want them to be more intelligent, read them more fairy tales."
* -- Albert Einstein
*/
(function(){
var root = this;
+17
View File
@@ -0,0 +1,17 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = Phaser;
}
exports.Phaser = Phaser;
} else if (typeof define !== 'undefined' && define.amd) {
define(Phaser);
} else {
root.Phaser = Phaser;
}
}).call(this);
+1 -1
View File
@@ -211,7 +211,7 @@ Phaser.BitmapText.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
if (this.parent.instanceof Phaser.Group)
if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
+1 -1
View File
@@ -148,7 +148,7 @@ Phaser.Graphics.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
if (this.parent.instanceof Phaser.Group)
if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
+1 -1
View File
@@ -376,7 +376,7 @@ Phaser.Image.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
if (this.parent.instanceof Phaser.Group)
if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
+1 -1
View File
@@ -499,7 +499,7 @@ Phaser.Sprite.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
if (this.parent.instanceof Phaser.Group)
if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
+1 -1
View File
@@ -191,7 +191,7 @@ Phaser.Text.prototype.destroy = function (destroyChildren) {
if (this.parent)
{
if (this.parent.instanceof Phaser.Group)
if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
+1 -1
View File
@@ -291,7 +291,7 @@ Phaser.TileSprite.prototype.destroy = function(destroyChildren) {
if (this.parent)
{
if (this.parent.instanceof Phaser.Group)
if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
+10662
View File
File diff suppressed because it is too large Load Diff
-61
View File
@@ -240,66 +240,6 @@ Phaser.Utils = {
};
/**
* Converts a hex color number to an [R, G, B] array
*
* @method hex2rgb
* @param hex {Number}
*/
PIXI.hex2rgb = function(hex) {
return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
};
/**
* Converts a color as an [R, G, B] array to a hex number
*
* @method rgb2hex
* @param rgb {Array}
*/
PIXI.rgb2hex = function(rgb) {
return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255);
};
/**
* Checks whether the Canvas BlendModes are supported by the current browser
*
* @method canUseNewCanvasBlendModes
* @return {Boolean} whether they are supported
*/
PIXI.canUseNewCanvasBlendModes = function()
{
var canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = 1;
var context = canvas.getContext('2d');
context.fillStyle = '#000';
context.fillRect(0,0,1,1);
context.globalCompositeOperation = 'multiply';
context.fillStyle = '#fff';
context.fillRect(0,0,1,1);
return context.getImageData(0,0,1,1).data[0] === 0;
};
/**
* Given a number, this function returns the closest number that is a power of two
* this function is taken from Starling Framework as its pretty neat ;)
*
* @method getNextPowerOfTwo
* @param number {Number}
* @return {Number} the closest number that is a power of two
*/
PIXI.getNextPowerOfTwo = function(number)
{
if (number > 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj
return number;
else
{
var result = 1;
while (result < number) result <<= 1;
return result;
}
};
/**
* A polyfill for Function.prototype.bind
*/
@@ -345,4 +285,3 @@ if (!Array.isArray) {
return Object.prototype.toString.call(arg) == '[object Array]';
};
}
+28
View File
@@ -0,0 +1,28 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*
* @overview
*
* Phaser - http://www.phaser.io
*
* v<%= version %> "Aes Sedai" - Built at: <%= buildDate %>
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
* Phaser is a fun, free and fast 2D game framework for making HTML5 games
* for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
*
* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com @Doormat23
* Phaser uses p2.js for physics, created by Stefan Hedman https://github.com/schteppe/p2.js @schteppe
*
* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from which both Phaser
* and my love of framework development originate.
*
* Follow Phaser development progress at http://phaser.io
*
* "If you want your children to be intelligent, read them fairy tales."
* "If you want them to be more intelligent, read them more fairy tales."
* -- Albert Einstein
*/