mirror of
https://github.com/wassname/phaser.git
synced 2026-07-16 01:20:13 +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:
+42
-42
@@ -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>
|
||||
@@ -559,13 +567,11 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
|
||||
|
||||
/**
|
||||
* @property {Phaser.RequestAnimationFrame} raf - Automatically handles the core game loop via requestAnimationFrame or setTimeout
|
||||
* @default
|
||||
*/
|
||||
this.raf = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.GameObjectFactory} add - Reference to the GameObject Factory.
|
||||
* @default
|
||||
*/
|
||||
this.add = null;
|
||||
|
||||
@@ -589,91 +595,81 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
|
||||
|
||||
/**
|
||||
* @property {Phaser.Math} math - Reference to the math helper.
|
||||
* @default
|
||||
*/
|
||||
this.math = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Net} net - Reference to the network class.
|
||||
* @default
|
||||
*/
|
||||
this.net = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.StageScaleMode} scale - The game scale manager.
|
||||
*/
|
||||
this.scale = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.SoundManager} sound - Reference to the sound manager.
|
||||
* @default
|
||||
*/
|
||||
this.sound = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Stage} stage - Reference to the stage.
|
||||
* @default
|
||||
*/
|
||||
this.stage = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.TimeManager} time - Reference to game clock.
|
||||
* @default
|
||||
*/
|
||||
this.time = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.TweenManager} tweens - Reference to the tween manager.
|
||||
* @default
|
||||
*/
|
||||
this.tweens = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.World} world - Reference to the world.
|
||||
* @default
|
||||
*/
|
||||
this.world = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Physics.PhysicsManager} physics - Reference to the physics manager.
|
||||
* @default
|
||||
* @property {Phaser.Physics.World} physics - Reference to the physics world.
|
||||
*/
|
||||
this.physics = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.RandomDataGenerator} rnd - Instance of repeatable random data generator helper.
|
||||
* @default
|
||||
*/
|
||||
this.rnd = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Device} device - Contains device information and capabilities.
|
||||
* @default
|
||||
*/
|
||||
this.device = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Physics.PhysicsManager} camera - A handy reference to world.camera.
|
||||
* @default
|
||||
*/
|
||||
this.camera = null;
|
||||
|
||||
/**
|
||||
* @property {HTMLCanvasElement} canvas - A handy reference to renderer.view.
|
||||
* @default
|
||||
/**
|
||||
* @property {HTMLCanvasElement} canvas - A handy reference to renderer.view, the canvas that the game is being rendered in to.
|
||||
*/
|
||||
this.canvas = null;
|
||||
|
||||
/**
|
||||
* @property {Context} context - A handy reference to renderer.context (only set for CANVAS games)
|
||||
* @default
|
||||
* @property {Context} context - A handy reference to renderer.context (only set for CANVAS games, not WebGL)
|
||||
*/
|
||||
this.context = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Utils.Debug} debug - A set of useful debug utilitie.
|
||||
* @default
|
||||
*/
|
||||
this.debug = null;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Particles} particles - The Particle Manager.
|
||||
* @default
|
||||
*/
|
||||
this.particles = null;
|
||||
|
||||
@@ -886,6 +882,7 @@ Phaser.Game.prototype = {
|
||||
this.rnd = new Phaser.RandomDataGenerator([(Date.now() * Math.random()).toString()]);
|
||||
|
||||
this.stage = new Phaser.Stage(this, this.width, this.height);
|
||||
this.scale = new Phaser.StageScaleMode(this, this.width, this.height);
|
||||
|
||||
this.setUpRenderer();
|
||||
|
||||
@@ -897,7 +894,7 @@ Phaser.Game.prototype = {
|
||||
this.tweens = new Phaser.TweenManager(this);
|
||||
this.input = new Phaser.Input(this);
|
||||
this.sound = new Phaser.SoundManager(this);
|
||||
this.physics = new Phaser.Physics.Arcade(this);
|
||||
this.physics = new Phaser.Physics.World(this);
|
||||
this.particles = new Phaser.Particles(this);
|
||||
this.plugins = new Phaser.PluginManager(this, this);
|
||||
this.net = new Phaser.Net(this);
|
||||
@@ -994,9 +991,9 @@ Phaser.Game.prototype = {
|
||||
this.renderType = Phaser.CANVAS;
|
||||
}
|
||||
|
||||
this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.stage.canvas, this.transparent);
|
||||
this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.canvas, this.transparent);
|
||||
Phaser.Canvas.setSmoothingEnabled(this.renderer.context, this.antialias);
|
||||
this.canvas = this.renderer.view;
|
||||
// this.canvas = this.renderer.view;
|
||||
this.context = this.renderer.context;
|
||||
}
|
||||
else
|
||||
@@ -1008,13 +1005,16 @@ Phaser.Game.prototype = {
|
||||
{
|
||||
// They requested WebGL, and their browser supports it
|
||||
this.renderType = Phaser.WEBGL;
|
||||
this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.stage.canvas, this.transparent, this.antialias);
|
||||
this.canvas = this.renderer.view;
|
||||
this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.canvas, this.transparent, this.antialias);
|
||||
// this.canvas = this.renderer.view;
|
||||
this.context = null;
|
||||
}
|
||||
|
||||
Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true);
|
||||
Phaser.Canvas.setTouchAction(this.renderer.view);
|
||||
// Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true);
|
||||
// Phaser.Canvas.setTouchAction(this.renderer.view);
|
||||
|
||||
Phaser.Canvas.addToDOM(this.canvas, this.parent, true);
|
||||
Phaser.Canvas.setTouchAction(this.canvas);
|
||||
|
||||
},
|
||||
|
||||
@@ -1045,7 +1045,7 @@ Phaser.Game.prototype = {
|
||||
|
||||
if (this._paused)
|
||||
{
|
||||
this.renderer.render(this.stage._stage);
|
||||
this.renderer.render(this.stage);
|
||||
this.plugins.render();
|
||||
this.state.render();
|
||||
}
|
||||
@@ -1059,24 +1059,24 @@ Phaser.Game.prototype = {
|
||||
}
|
||||
|
||||
this.plugins.preUpdate();
|
||||
this.world.preUpdate();
|
||||
this.stage.preUpdate();
|
||||
|
||||
this.stage.update();
|
||||
this.tweens.update();
|
||||
this.sound.update();
|
||||
this.input.update();
|
||||
this.state.update();
|
||||
this.world.update();
|
||||
this.physics.update();
|
||||
this.particles.update();
|
||||
this.plugins.update();
|
||||
|
||||
this.world.postUpdate();
|
||||
this.stage.postUpdate();
|
||||
this.plugins.postUpdate();
|
||||
}
|
||||
|
||||
if (this.renderType !== Phaser.HEADLESS)
|
||||
{
|
||||
this.renderer.render(this.stage._stage);
|
||||
this.renderer.render(this.stage);
|
||||
this.plugins.render();
|
||||
this.state.render();
|
||||
|
||||
@@ -1213,7 +1213,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
|
||||
|
||||
<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:16 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