mirror of
https://github.com/wassname/phaser.git
synced 2026-09-10 12:29:30 +08:00
Camera culling
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user