Skip to content

Commit 6d21d39

Browse files
committed
Fix scrollfactor test for using new component based sprite.
1 parent b0d3f6e commit 6d21d39

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Tests/cameras/scrollfactor-compare.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@
1414
function create() {
1515
// background sky, which does not move at all
1616
game.add.sprite(0, 0, 'sky')
17-
.scrollFactor.setTo(0, 0);
17+
.transform.scrollFactor.setTo(0, 0);
1818

1919
// clouds with different scroll factor which moves slower than camera
2020
game.add.sprite(200, 120, 'cloud0')
21-
.scrollFactor.setTo(0.3, 0.3);
21+
.transform.scrollFactor.setTo(0.3, 0.3);
2222
game.add.sprite(-60, 120, 'cloud1')
23-
.scrollFactor.setTo(0.5, 0.3);
23+
.transform.scrollFactor.setTo(0.5, 0.3);
2424
game.add.sprite(900, 170, 'cloud2')
25-
.scrollFactor.setTo(0.7, 0.3);
25+
.transform.scrollFactor.setTo(0.7, 0.3);
2626

2727
// forground objects which moves equal or faster than camera
2828
game.add.sprite(0, 360, 'ground')
29-
.scrollFactor.setTo(0.5, 0.5);
29+
.transform.scrollFactor.setTo(0.5, 0.5);
3030
game.add.sprite(0, 400, 'river')
31-
.scrollFactor.setTo(1.3, 1.3);
31+
.transform.scrollFactor.setTo(1.3, 1.3);
3232
}
3333
function update() {
3434
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
35-
game.camera.scroll.x -= 3;
35+
game.camera.x -= 3;
3636
}
3737
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
38-
game.camera.scroll.x += 3;
38+
game.camera.x += 3;
3939
}
4040
}
4141
function render() {

0 commit comments

Comments
 (0)