mirror of
https://github.com/wassname/phaser.git
synced 2026-07-19 11:26:26 +08:00
Tilemap.createCollisionObjects will parse Tiled data for objectgroups and convert polyline instances into physics objects you can collide with in the world.
After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required. Debug.renderPhysicsBody updated to take camera location and body rotation into account. Body movement functions put back to velocity :) Updated to latest dev version of pixi and latest p2.js Updated docs
This commit is contained in:
+20
-90
@@ -58,6 +58,10 @@
|
||||
<a href="Phaser.BitmapData.html">BitmapData</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.BitmapFont.html">BitmapFont</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.BitmapText.html">BitmapText</a>
|
||||
</li>
|
||||
@@ -90,10 +94,6 @@
|
||||
<a href="Phaser.Device.html">Device</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.DOMSprite.html">DOMSprite</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Easing.html">Easing</a>
|
||||
</li>
|
||||
@@ -142,6 +142,10 @@
|
||||
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Ellipse.html">Ellipse</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Events.html">Events</a>
|
||||
</li>
|
||||
@@ -250,10 +254,6 @@
|
||||
<a href="Phaser.Physics.Arcade.html">Arcade</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Plugin.html">Plugin</a>
|
||||
</li>
|
||||
@@ -314,6 +314,10 @@
|
||||
<a href="Phaser.Sprite.html">Sprite</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Stage.html">Stage</a>
|
||||
</li>
|
||||
@@ -412,6 +416,10 @@
|
||||
<a href="global.html#canUseNewCanvasBlendModes">canUseNewCanvasBlendModes</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#getBounds">getBounds</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#getNextPowerOfTwo">getNextPowerOfTwo</a>
|
||||
</li>
|
||||
@@ -490,7 +498,7 @@ Phaser.World = function (game) {
|
||||
*/
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Phaser.World.prototype = Object.create(Phaser.Group.prototype);
|
||||
Phaser.World.prototype.constructor = Phaser.World;
|
||||
@@ -509,84 +517,7 @@ Phaser.World.prototype.boot = function () {
|
||||
|
||||
this.game.camera = this.camera;
|
||||
|
||||
this.game.stage._stage.addChild(this);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called automatically after the plugins preUpdate and before the State.update.
|
||||
* Most objects have preUpdate methods and it's where initial movement, drawing and calculations are done.
|
||||
*
|
||||
* @method Phaser.World#preUpdate
|
||||
*/
|
||||
Phaser.World.prototype.preUpdate = function () {
|
||||
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
for (var i = 0, len = this.children.length; i < len; i++)
|
||||
{
|
||||
if (this.children[i]['preUpdate'])
|
||||
{
|
||||
this.children[i].preUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called automatically after the State.update, but before particles or plugins update.
|
||||
* Most objects won't have an update method set unless explicitly given one.
|
||||
*
|
||||
* @method Phaser.World#update
|
||||
*/
|
||||
Phaser.World.prototype.update = function () {
|
||||
|
||||
for (var i = 0, len = this.children.length; i < len; i++)
|
||||
{
|
||||
if (this.children[i]['update'])
|
||||
{
|
||||
this.children[i].update();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called automatically before the renderer runs and after the plugins have updated.
|
||||
* In postUpdate this is where all the final physics calculatations and object positioning happens.
|
||||
* The objects are processed in the order of the display list.
|
||||
* The only exception to this is if the camera is following an object, in which case that is updated first.
|
||||
*
|
||||
* @method Phaser.World#postUpdate
|
||||
*/
|
||||
Phaser.World.prototype.postUpdate = function () {
|
||||
|
||||
if (this.camera.target && this.camera.target['postUpdate'])
|
||||
{
|
||||
this.camera.target.postUpdate();
|
||||
|
||||
this.camera.update();
|
||||
|
||||
for (var i = 0, len = this.children.length; i < len; i++)
|
||||
{
|
||||
if (this.children[i]['postUpdate'])
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.camera.update();
|
||||
|
||||
for (var i = 0, len = this.children.length; i < len; i++)
|
||||
{
|
||||
if (this.children[i]['postUpdate'])
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.game.stage.addChild(this);
|
||||
|
||||
}
|
||||
|
||||
@@ -629,8 +560,7 @@ Phaser.World.prototype.setBounds = function (x, y, width, height) {
|
||||
*/
|
||||
Phaser.World.prototype.destroy = function () {
|
||||
|
||||
this.camera.x = 0;
|
||||
this.camera.y = 0;
|
||||
this.camera.reset();
|
||||
|
||||
this.game.input.reset(true);
|
||||
|
||||
@@ -761,7 +691,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
|
||||
on Sat Feb 08 2014 07:19:40 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Tue Feb 18 2014 03:01:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user