File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,6 +154,16 @@ var World = new Class({
154154 */
155155 this . fps = GetValue ( config , 'fps' , 60 ) ;
156156
157+ /**
158+ * Physics/Render synchronisation. This property disables fps and timeScale properties.
159+ *
160+ * @name Phaser.Physics.Arcade.World#syncToRender
161+ * @type {boolean }
162+ * @default false
163+ * @since 3.23.0
164+ */
165+ this . syncToRender = false ;
166+
157167 /**
158168 * The amount of elapsed ms since the last frame.
159169 *
@@ -927,6 +937,13 @@ var World = new Class({
927937 // Will a step happen this frame?
928938 var willStep = ( this . _elapsed >= msPerFrame ) ;
929939
940+ if ( this . syncToRender )
941+ {
942+ fixedDelta = delta * 0.001 ;
943+ willStep = true ;
944+ this . _elapsed = 0 ;
945+ }
946+
930947 for ( i = 0 ; i < bodies . length ; i ++ )
931948 {
932949 body = bodies [ i ] ;
You can’t perform that action at this time.
0 commit comments