mirror of
				https://github.com/GayPizzaSpecifications/voxelotl-engine.git
				synced 2025-11-04 02:59:37 +00:00 
			
		
		
		
	prevent gameplay time delta getting too high
This commit is contained in:
		@ -42,11 +42,12 @@ class Game: GameDelegate {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  func update(_ time: GameTime) {
 | 
					  func update(_ time: GameTime) {
 | 
				
			||||||
    let deltaTime = Float(time.delta.asFloat)
 | 
					 | 
				
			||||||
    fpsCalculator.frame(deltaTime: time.delta) { fps in
 | 
					    fpsCalculator.frame(deltaTime: time.delta) { fps in
 | 
				
			||||||
      print("FPS: \(fps)")
 | 
					      print("FPS: \(fps)")
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let deltaTime = min(Float(time.delta.asFloat), 1.0 / 15)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    player.update(deltaTime: deltaTime, boxes: boxes)
 | 
					    player.update(deltaTime: deltaTime, boxes: boxes)
 | 
				
			||||||
    camera.position = player.position
 | 
					    camera.position = player.position
 | 
				
			||||||
    camera.rotation =
 | 
					    camera.rotation =
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user