mirror of
https://github.com/wassname/phaser.git
synced 2026-08-06 13:31:05 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f23c378a1 | ||
|
|
b6f8a3fba6 | ||
|
|
cb9cb6e894 | ||
|
|
e948f1e3be | ||
|
|
4c21ac0d87 | ||
|
|
db9b8ec370 | ||
|
|
f66e0e9254 |
+35
-35
@@ -14,40 +14,40 @@ module.exports = function (grunt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
copy: {
|
copy: {
|
||||||
main: {
|
main: {
|
||||||
files: [{
|
files: [{
|
||||||
src: 'build/phaser.js',
|
src: 'build/phaser.js',
|
||||||
dest: 'Tests/phaser.js'
|
dest: 'Tests/phaser.js'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
amd: {
|
amd: {
|
||||||
files: [{
|
files: [{
|
||||||
src: 'build/phaser.js',
|
src: 'build/phaser.js',
|
||||||
dest: 'build/phaser.amd.js'
|
dest: 'build/phaser.amd.js'
|
||||||
}],
|
}],
|
||||||
options: {
|
options: {
|
||||||
processContent: function(content) {
|
processContent: function(content) {
|
||||||
var replacement = [
|
var replacement = [
|
||||||
'(function (root, factory) {',
|
'(function (root, factory) {',
|
||||||
' if (typeof exports === \'object\') {',
|
' if (typeof exports === \'object\') {',
|
||||||
' module.exports = factory();',
|
' module.exports = factory();',
|
||||||
' } else if (typeof define === \'function\' && define.amd) {',
|
' } else if (typeof define === \'function\' && define.amd) {',
|
||||||
' define(factory);',
|
' define(factory);',
|
||||||
' } else {',
|
' } else {',
|
||||||
' root.Phaser = factory();',
|
' root.Phaser = factory();',
|
||||||
' }',
|
' }',
|
||||||
'}(this, function () {',
|
'}(this, function () {',
|
||||||
content,
|
content,
|
||||||
'return Phaser;',
|
'return Phaser;',
|
||||||
'}));'
|
'}));'
|
||||||
];
|
];
|
||||||
return replacement.join('\n');
|
return replacement.join('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
files: '**/*.ts',
|
files: '**/*.ts',
|
||||||
tasks: ['typescript', 'copy']
|
tasks: ['typescript', 'copy']
|
||||||
}
|
}
|
||||||
@@ -55,4 +55,4 @@ module.exports = function (grunt) {
|
|||||||
|
|
||||||
grunt.registerTask('default', ['watch']);
|
grunt.registerTask('default', ['watch']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,14 +96,6 @@
|
|||||||
<TypeScriptCompile Include="sprites\dynamic texture 1.ts" />
|
<TypeScriptCompile Include="sprites\dynamic texture 1.ts" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="tweens\properties.js">
|
|
||||||
<DependentUpon>properties.ts</DependentUpon>
|
|
||||||
</Content>
|
|
||||||
<TypeScriptCompile Include="tweens\properties.ts" />
|
|
||||||
<TypeScriptCompile Include="misc\screen grab.ts" />
|
|
||||||
<Content Include="misc\screen grab.js">
|
|
||||||
<DependentUpon>screen grab.ts</DependentUpon>
|
|
||||||
</Content>
|
|
||||||
<TypeScriptCompile Include="sprites\align.ts" />
|
<TypeScriptCompile Include="sprites\align.ts" />
|
||||||
<TypeScriptCompile Include="scrollzones\simple scrollzone.ts" />
|
<TypeScriptCompile Include="scrollzones\simple scrollzone.ts" />
|
||||||
<TypeScriptCompile Include="scrollzones\ballscroller.ts" />
|
<TypeScriptCompile Include="scrollzones\ballscroller.ts" />
|
||||||
|
|||||||
+17
-12
@@ -3621,7 +3621,7 @@ var Phaser;
|
|||||||
* @return {Boolean} A value of true if the Circle objects diameter is less than or equal to 0; otherwise false.
|
* @return {Boolean} A value of true if the Circle objects diameter is less than or equal to 0; otherwise false.
|
||||||
**/
|
**/
|
||||||
function () {
|
function () {
|
||||||
if(this._diameter < 1) {
|
if(this._diameter <= 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -7619,7 +7619,7 @@ var Phaser;
|
|||||||
/**
|
/**
|
||||||
* Phaser
|
* Phaser
|
||||||
*
|
*
|
||||||
* v0.9.4 - April 24th 2013
|
* v0.9.4 - April 28th 2013
|
||||||
*
|
*
|
||||||
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
|
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
|
||||||
*
|
*
|
||||||
@@ -8486,7 +8486,6 @@ var Phaser;
|
|||||||
this.onStart.dispatch(this._object);
|
this.onStart.dispatch(this._object);
|
||||||
this._startTime = this._game.time.now + this._delayTime;
|
this._startTime = this._game.time.now + this._delayTime;
|
||||||
for(var property in this._valuesEnd) {
|
for(var property in this._valuesEnd) {
|
||||||
console.log(typeof property);
|
|
||||||
// This prevents the interpolation of null values or of non-existing properties
|
// This prevents the interpolation of null values or of non-existing properties
|
||||||
if(this._object[property] === null || !(property in this._object)) {
|
if(this._object[property] === null || !(property in this._object)) {
|
||||||
throw Error('Phaser.Tween interpolation of null value of non-existing property');
|
throw Error('Phaser.Tween interpolation of null value of non-existing property');
|
||||||
@@ -8665,8 +8664,8 @@ var Phaser;
|
|||||||
var World = (function () {
|
var World = (function () {
|
||||||
function World(game, width, height) {
|
function World(game, width, height) {
|
||||||
this._game = game;
|
this._game = game;
|
||||||
this._cameras = new Phaser.CameraManager(this._game, 0, 0, width, height);
|
this.cameras = new Phaser.CameraManager(this._game, 0, 0, width, height);
|
||||||
this._game.camera = this._cameras.current;
|
this._game.camera = this.cameras.current;
|
||||||
this.group = new Phaser.Group(this._game, 0);
|
this.group = new Phaser.Group(this._game, 0);
|
||||||
this.bounds = new Phaser.Rectangle(0, 0, width, height);
|
this.bounds = new Phaser.Rectangle(0, 0, width, height);
|
||||||
this.worldDivisions = 6;
|
this.worldDivisions = 6;
|
||||||
@@ -8675,15 +8674,15 @@ var Phaser;
|
|||||||
this.group.preUpdate();
|
this.group.preUpdate();
|
||||||
this.group.update();
|
this.group.update();
|
||||||
this.group.postUpdate();
|
this.group.postUpdate();
|
||||||
this._cameras.update();
|
this.cameras.update();
|
||||||
};
|
};
|
||||||
World.prototype.render = function () {
|
World.prototype.render = function () {
|
||||||
// Unlike in flixel our render process is camera driven, not group driven
|
// Unlike in flixel our render process is camera driven, not group driven
|
||||||
this._cameras.render();
|
this.cameras.render();
|
||||||
};
|
};
|
||||||
World.prototype.destroy = function () {
|
World.prototype.destroy = function () {
|
||||||
this.group.destroy();
|
this.group.destroy();
|
||||||
this._cameras.destroy();
|
this.cameras.destroy();
|
||||||
};
|
};
|
||||||
World.prototype.setSize = // World methods
|
World.prototype.setSize = // World methods
|
||||||
function (width, height, updateCameraBounds) {
|
function (width, height, updateCameraBounds) {
|
||||||
@@ -8744,13 +8743,13 @@ var Phaser;
|
|||||||
});
|
});
|
||||||
World.prototype.createCamera = // Cameras
|
World.prototype.createCamera = // Cameras
|
||||||
function (x, y, width, height) {
|
function (x, y, width, height) {
|
||||||
return this._cameras.addCamera(x, y, width, height);
|
return this.cameras.addCamera(x, y, width, height);
|
||||||
};
|
};
|
||||||
World.prototype.removeCamera = function (id) {
|
World.prototype.removeCamera = function (id) {
|
||||||
return this._cameras.removeCamera(id);
|
return this.cameras.removeCamera(id);
|
||||||
};
|
};
|
||||||
World.prototype.getAllCameras = function () {
|
World.prototype.getAllCameras = function () {
|
||||||
return this._cameras.getAll();
|
return this.cameras.getAll();
|
||||||
};
|
};
|
||||||
World.prototype.createSprite = // Game Objects
|
World.prototype.createSprite = // Game Objects
|
||||||
function (x, y, key) {
|
function (x, y, key) {
|
||||||
@@ -11859,7 +11858,6 @@ var Phaser;
|
|||||||
this.onUpdateCallback = null;
|
this.onUpdateCallback = null;
|
||||||
this.onRenderCallback = null;
|
this.onRenderCallback = null;
|
||||||
this.onPausedCallback = null;
|
this.onPausedCallback = null;
|
||||||
this.camera = null;
|
|
||||||
this.cache = null;
|
this.cache = null;
|
||||||
this.input = null;
|
this.input = null;
|
||||||
this.loader = null;
|
this.loader = null;
|
||||||
@@ -11947,6 +11945,13 @@ var Phaser;
|
|||||||
if (typeof notifyCallback === "undefined") { notifyCallback = null; }
|
if (typeof notifyCallback === "undefined") { notifyCallback = null; }
|
||||||
return this.collision.overlap(objectOrGroup1, objectOrGroup2, notifyCallback, Phaser.Collision.separate);
|
return this.collision.overlap(objectOrGroup1, objectOrGroup2, notifyCallback, Phaser.Collision.separate);
|
||||||
};
|
};
|
||||||
|
Object.defineProperty(Game.prototype, "camera", {
|
||||||
|
get: function () {
|
||||||
|
return this.world.cameras.current;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
return Game;
|
return Game;
|
||||||
})();
|
})();
|
||||||
Phaser.Game = Game;
|
Phaser.Game = Game;
|
||||||
|
|||||||
@@ -3621,7 +3621,7 @@ var Phaser;
|
|||||||
* @return {Boolean} A value of true if the Circle objects diameter is less than or equal to 0; otherwise false.
|
* @return {Boolean} A value of true if the Circle objects diameter is less than or equal to 0; otherwise false.
|
||||||
**/
|
**/
|
||||||
function () {
|
function () {
|
||||||
if(this._diameter < 1) {
|
if(this._diameter <= 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -7619,7 +7619,7 @@ var Phaser;
|
|||||||
/**
|
/**
|
||||||
* Phaser
|
* Phaser
|
||||||
*
|
*
|
||||||
* v0.9.4 - April 24th 2013
|
* v0.9.4 - April 28th 2013
|
||||||
*
|
*
|
||||||
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
|
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
|
||||||
*
|
*
|
||||||
@@ -8486,7 +8486,6 @@ var Phaser;
|
|||||||
this.onStart.dispatch(this._object);
|
this.onStart.dispatch(this._object);
|
||||||
this._startTime = this._game.time.now + this._delayTime;
|
this._startTime = this._game.time.now + this._delayTime;
|
||||||
for(var property in this._valuesEnd) {
|
for(var property in this._valuesEnd) {
|
||||||
console.log(typeof property);
|
|
||||||
// This prevents the interpolation of null values or of non-existing properties
|
// This prevents the interpolation of null values or of non-existing properties
|
||||||
if(this._object[property] === null || !(property in this._object)) {
|
if(this._object[property] === null || !(property in this._object)) {
|
||||||
throw Error('Phaser.Tween interpolation of null value of non-existing property');
|
throw Error('Phaser.Tween interpolation of null value of non-existing property');
|
||||||
@@ -8665,8 +8664,8 @@ var Phaser;
|
|||||||
var World = (function () {
|
var World = (function () {
|
||||||
function World(game, width, height) {
|
function World(game, width, height) {
|
||||||
this._game = game;
|
this._game = game;
|
||||||
this._cameras = new Phaser.CameraManager(this._game, 0, 0, width, height);
|
this.cameras = new Phaser.CameraManager(this._game, 0, 0, width, height);
|
||||||
this._game.camera = this._cameras.current;
|
this._game.camera = this.cameras.current;
|
||||||
this.group = new Phaser.Group(this._game, 0);
|
this.group = new Phaser.Group(this._game, 0);
|
||||||
this.bounds = new Phaser.Rectangle(0, 0, width, height);
|
this.bounds = new Phaser.Rectangle(0, 0, width, height);
|
||||||
this.worldDivisions = 6;
|
this.worldDivisions = 6;
|
||||||
@@ -8675,15 +8674,15 @@ var Phaser;
|
|||||||
this.group.preUpdate();
|
this.group.preUpdate();
|
||||||
this.group.update();
|
this.group.update();
|
||||||
this.group.postUpdate();
|
this.group.postUpdate();
|
||||||
this._cameras.update();
|
this.cameras.update();
|
||||||
};
|
};
|
||||||
World.prototype.render = function () {
|
World.prototype.render = function () {
|
||||||
// Unlike in flixel our render process is camera driven, not group driven
|
// Unlike in flixel our render process is camera driven, not group driven
|
||||||
this._cameras.render();
|
this.cameras.render();
|
||||||
};
|
};
|
||||||
World.prototype.destroy = function () {
|
World.prototype.destroy = function () {
|
||||||
this.group.destroy();
|
this.group.destroy();
|
||||||
this._cameras.destroy();
|
this.cameras.destroy();
|
||||||
};
|
};
|
||||||
World.prototype.setSize = // World methods
|
World.prototype.setSize = // World methods
|
||||||
function (width, height, updateCameraBounds) {
|
function (width, height, updateCameraBounds) {
|
||||||
@@ -8744,13 +8743,13 @@ var Phaser;
|
|||||||
});
|
});
|
||||||
World.prototype.createCamera = // Cameras
|
World.prototype.createCamera = // Cameras
|
||||||
function (x, y, width, height) {
|
function (x, y, width, height) {
|
||||||
return this._cameras.addCamera(x, y, width, height);
|
return this.cameras.addCamera(x, y, width, height);
|
||||||
};
|
};
|
||||||
World.prototype.removeCamera = function (id) {
|
World.prototype.removeCamera = function (id) {
|
||||||
return this._cameras.removeCamera(id);
|
return this.cameras.removeCamera(id);
|
||||||
};
|
};
|
||||||
World.prototype.getAllCameras = function () {
|
World.prototype.getAllCameras = function () {
|
||||||
return this._cameras.getAll();
|
return this.cameras.getAll();
|
||||||
};
|
};
|
||||||
World.prototype.createSprite = // Game Objects
|
World.prototype.createSprite = // Game Objects
|
||||||
function (x, y, key) {
|
function (x, y, key) {
|
||||||
@@ -11859,7 +11858,6 @@ var Phaser;
|
|||||||
this.onUpdateCallback = null;
|
this.onUpdateCallback = null;
|
||||||
this.onRenderCallback = null;
|
this.onRenderCallback = null;
|
||||||
this.onPausedCallback = null;
|
this.onPausedCallback = null;
|
||||||
this.camera = null;
|
|
||||||
this.cache = null;
|
this.cache = null;
|
||||||
this.input = null;
|
this.input = null;
|
||||||
this.loader = null;
|
this.loader = null;
|
||||||
@@ -11947,6 +11945,13 @@ var Phaser;
|
|||||||
if (typeof notifyCallback === "undefined") { notifyCallback = null; }
|
if (typeof notifyCallback === "undefined") { notifyCallback = null; }
|
||||||
return this.collision.overlap(objectOrGroup1, objectOrGroup2, notifyCallback, Phaser.Collision.separate);
|
return this.collision.overlap(objectOrGroup1, objectOrGroup2, notifyCallback, Phaser.Collision.separate);
|
||||||
};
|
};
|
||||||
|
Object.defineProperty(Game.prototype, "camera", {
|
||||||
|
get: function () {
|
||||||
|
return this.world.cameras.current;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
return Game;
|
return Game;
|
||||||
})();
|
})();
|
||||||
Phaser.Game = Game;
|
Phaser.Game = Game;
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user