Camera culling

This commit is contained in:
Richard Davey
2013-09-01 19:52:50 +01:00
parent 7bdcbf5c2a
commit d31777972c
8 changed files with 188 additions and 65 deletions
+1 -5
View File
@@ -15,7 +15,6 @@
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
var s;
var r;
function preload() {
game.load.image('test', 'assets/sprites/mana_card.png');
@@ -26,20 +25,17 @@
s = game.add.sprite(game.world.centerX, game.world.centerY, 'test');
s.anchor.setTo(0.5, 0.5);
r = s.getBounds(r);
}
function update() {
s.angle += 1;
s.getBounds(r);
}
function render() {
game.debug.renderRectangle(r);
game.debug.renderRectangle(s.bounds);
}