Increase camera speed when time goes by
This commit is contained in:
		
							parent
							
								
									6b5df53e3f
								
							
						
					
					
						commit
						3ca4681a74
					
				| @ -20,6 +20,10 @@ class Scene extends Screen { | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     updateCameraSpeed(height) { | ||||
|         this.cameraSpeed = 0.0005 + (height / 200) * 0.0001; | ||||
|     } | ||||
| 
 | ||||
|     get maxHeight() { | ||||
|         return window.localStorage.getItem("maxHeight"); | ||||
|     } | ||||
| @ -194,6 +198,10 @@ class Scene extends Screen { | ||||
| 
 | ||||
|         // Update coin frames
 | ||||
|         this.collectables.map((c) => c.update(time)); | ||||
| 
 | ||||
|         if (this.started) { | ||||
|             this.updateCameraSpeed(heightToScore(this.currentHeight)); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     addPlatform(object) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user