mirror of
https://github.com/wassname/phaser.git
synced 2026-07-27 11:25:30 +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:
+51
-10
@@ -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>
|
||||
@@ -787,7 +795,18 @@ Phaser.Math = {
|
||||
* @return {number}
|
||||
*/
|
||||
angleBetween: function (x1, y1, x2, y2) {
|
||||
return Math.atan2(y2 - y1, x2 - x1);
|
||||
return Math.atan2(x2 - x1, y2 - y1);
|
||||
},
|
||||
|
||||
/**
|
||||
* Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).
|
||||
* @method Phaser.Math#angleBetweenPoints
|
||||
* @param {Phaser.Point} point1
|
||||
* @param {Phaser.Point} point2
|
||||
* @return {number}
|
||||
*/
|
||||
angleBetweenPoints: function (point1, point2) {
|
||||
return Math.atan2(point2.x - point1.x, point2.y - point1.y);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1731,6 +1750,28 @@ Phaser.Math = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert p2 physics value to pixel scale.
|
||||
*
|
||||
* @method Phaser.Math#p2px
|
||||
* @param {number} v - The value to convert.
|
||||
* @return {number} The scaled value.
|
||||
*/
|
||||
p2px: function (v) {
|
||||
return v *= -20;
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert pixel value to p2 physics scale.
|
||||
*
|
||||
* @method Phaser.Math#px2p
|
||||
* @param {number} v - The value to convert.
|
||||
* @return {number} The scaled value.
|
||||
*/
|
||||
px2p: function (v) {
|
||||
return v * -0.05;
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert degrees to radians.
|
||||
*
|
||||
@@ -1789,7 +1830,7 @@ Phaser.Math = {
|
||||
|
||||
<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