Removed PixiPatch as it's no longer needed. Re-worked all of the Sprite autoCull and inWorld checks and cached the bounds. Fixed the Body calculations so physics is working again.

This commit is contained in:
photonstorm
2014-02-09 03:48:31 +00:00
parent e8b432f518
commit 4aa945f991
13 changed files with 104 additions and 378 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ function create() {
var bg = game.add.sprite(0, 0, bmd);
bg.body.moves = false;
game.enableStep();
// game.enableStep();
game.physics.gravity.y = 100;
+11 -13
View File
@@ -1,5 +1,5 @@
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }, false);
function preload() {
@@ -16,22 +16,20 @@ function create() {
// game.stage.backgroundColor = '#ff5500';
game.stage._stage.setBackgroundColor(0xff5500);
sprite = game.add.sprite(0.5, 0, 'pic');
sprite = game.add.sprite(0, 0, 'pic');
// g = game.add.group(null, 'billy');
g = game.add.group(null, 'billy');
// sprite2 = g.create(0, 0, 'pic');
sprite2 = g.create(0, 0, 'pic');
// g.y = 200;
// g.rotation = 0.1;
g.y = 200;
g.rotation = 0.1;
sprite2 = game.add.sprite(0, 300, 'pic');
// sprite2 = game.add.sprite(0, 300, 'pic');
// game.input.onDown.add(tint, this);
game.input.onDown.add(tint, this);
game.add.tween(sprite).to({y: 500}, 3000, Phaser.Easing.Linear.None, true);
// game.add.tween(sprite).to({y: 500}, 3000, Phaser.Easing.Linear.None, true);
p = new PIXI.Point(43, 45);
@@ -39,7 +37,7 @@ function create() {
function tint() {
sprite.tint = Math.random() * 0xFFFFFF;
// sprite.tint = Math.random() * 0xFFFFFF;
// sprite2.tint = Math.random() * 0xFFFFFF;
}
@@ -51,6 +49,6 @@ function update() {
function render() {
game.debug.renderText(sprite.position.y, 32, 32);
// game.debug.renderText(sprite.position.y, 32, 32);
}