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,17 @@ var World = new Class({
154154 */
155155 this . fps = GetValue ( config , 'fps' , 60 ) ;
156156
157+ /**
158+ * Should Physics use a fixed update time-step (true) or sync to the render fps (false)?.
159+ * False value of this property disables fps and timeScale properties.
160+ *
161+ * @name Phaser.Physics.Arcade.World#fixedStep
162+ * @type {boolean }
163+ * @default true
164+ * @since 3.23.0
165+ */
166+ this . fixedStep = true ;
167+
157168 /**
158169 * The amount of elapsed ms since the last frame.
159170 *
@@ -927,6 +938,13 @@ var World = new Class({
927938 // Will a step happen this frame?
928939 var willStep = ( this . _elapsed >= msPerFrame ) ;
929940
941+ if ( ! this . fixedStep )
942+ {
943+ fixedDelta = delta * 0.001 ;
944+ willStep = true ;
945+ this . _elapsed = 0 ;
946+ }
947+
930948 for ( i = 0 ; i < bodies . length ; i ++ )
931949 {
932950 body = bodies [ i ] ;
You can’t perform that action at this time.
0 commit comments