File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1493,10 +1493,7 @@ Phaser.Group.prototype.postUpdate = function () {
14931493 this . y = this . game . camera . view . y + this . cameraOffset . y ;
14941494 }
14951495
1496- // Goes in reverse to match the Stage postUpdate cycle, also again children may destroy themselves here.
1497- var i = this . children . length ;
1498-
1499- while ( i -- )
1496+ for ( var i = 0 ; i < this . children . length ; i ++ )
15001497 {
15011498 this . children [ i ] . postUpdate ( ) ;
15021499 }
Original file line number Diff line number Diff line change @@ -182,20 +182,23 @@ Phaser.Stage.prototype.postUpdate = function () {
182182 // Apply the camera shake, fade, bounds, etc
183183 this . game . camera . update ( ) ;
184184
185- var i = this . children . length ;
185+ // Camera target first?
186+ if ( this . game . camera . target )
187+ {
188+ this . game . camera . target . postUpdate ( ) ;
186189
187- while ( i -- )
190+ this . updateTransform ( ) ;
191+
192+ this . game . camera . updateTarget ( ) ;
193+ }
194+
195+ for ( var i = 0 ; i < this . children . length ; i ++ )
188196 {
189197 this . children [ i ] . postUpdate ( ) ;
190198 }
191199
192200 this . updateTransform ( ) ;
193201
194- if ( this . game . camera . target )
195- {
196- this . game . camera . updateTarget ( ) ;
197- }
198-
199202} ;
200203
201204/**
You can’t perform that action at this time.
0 commit comments