File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,24 +72,31 @@ Phaser.World.prototype.boot = function () {
7272Phaser . World . prototype . update = function ( ) {
7373
7474 this . currentRenderOrderID = 0 ;
75-
75+
7676 if ( this . game . stage . _stage . first . _iNext )
7777 {
7878 var currentNode = this . game . stage . _stage . first . _iNext ;
79+ var skipChildren = false ;
7980
8081 do
8182 {
8283 if ( currentNode [ 'preUpdate' ] )
8384 {
84- currentNode . preUpdate ( ) ;
85+ skipChildren = ( currentNode . preUpdate ( ) == false ) ;
8586 }
8687
8788 if ( currentNode [ 'update' ] )
8889 {
89- currentNode . update ( ) ;
90+ skipChildren = ( currentNode . update ( ) == false ) || skipChildren ;
9091 }
9192
92- currentNode = currentNode . _iNext ;
93+ if ( skipChildren )
94+ {
95+ currentNode = currentNode . last . _iNext ;
96+ } else {
97+ currentNode = currentNode . _iNext ;
98+ }
99+
93100 }
94101 while ( currentNode != this . game . stage . _stage . last . _iNext )
95102 }
Original file line number Diff line number Diff line change @@ -361,7 +361,9 @@ Phaser.Sprite.prototype.preUpdate = function() {
361361 if ( ! this . exists || ( this . group && ! this . group . exists ) )
362362 {
363363 this . renderOrderID = - 1 ;
364- return ;
364+
365+ // Skip children if not exists
366+ return false ;
365367 }
366368
367369 if ( this . lifespan > 0 )
@@ -371,7 +373,7 @@ Phaser.Sprite.prototype.preUpdate = function() {
371373 if ( this . lifespan <= 0 )
372374 {
373375 this . kill ( ) ;
374- return ;
376+ return false ;
375377 }
376378 }
377379
@@ -399,6 +401,8 @@ Phaser.Sprite.prototype.preUpdate = function() {
399401 this . body . preUpdate ( ) ;
400402 }
401403
404+ return true ;
405+
402406} ;
403407
404408/**
You can’t perform that action at this time.
0 commit comments