mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	chore: Remove 1.8.0 deprecations (#2538)
Removes all the deprecated methods before 1.8.0 release.
This commit is contained in:
		| @ -17,9 +17,14 @@ starts to drop in FPS, this is without any sprite batching and such. | ||||
|   final counterPrefix = 'Animations: '; | ||||
|   final Random random = Random(); | ||||
|  | ||||
|   final world = World(); | ||||
|   late final CameraComponent cameraComponent; | ||||
|  | ||||
|   @override | ||||
|   Future<void> onLoad() async { | ||||
|     await addAll([ | ||||
|     cameraComponent = CameraComponent(world: world); | ||||
|     addAll([cameraComponent, world]); | ||||
|     await cameraComponent.viewport.addAll([ | ||||
|       FpsTextComponent( | ||||
|         position: size - Vector2(0, 50), | ||||
|         anchor: Anchor.bottomRight, | ||||
| @ -29,29 +34,28 @@ starts to drop in FPS, this is without any sprite batching and such. | ||||
|         anchor: Anchor.bottomRight, | ||||
|         priority: 1, | ||||
|       ), | ||||
|       Ember(size: emberSize, position: size / 2), | ||||
|     ]); | ||||
|     world.add(Ember(size: emberSize, position: size / 2)); | ||||
|     children.register<Ember>(); | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   void update(double dt) { | ||||
|     super.update(dt); | ||||
|     emberCounter.text = '$counterPrefix ${children.query<Ember>().length}'; | ||||
|     emberCounter.text = | ||||
|         '$counterPrefix ${world.children.query<Ember>().length}'; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   void onTapDown(TapDownInfo info) { | ||||
|     final halfWidth = emberSize.x / 2; | ||||
|     final halfHeight = emberSize.y / 2; | ||||
|     addAll( | ||||
|     world.addAll( | ||||
|       List.generate( | ||||
|         100, | ||||
|         (_) => Ember( | ||||
|           size: emberSize, | ||||
|           position: Vector2( | ||||
|             halfWidth + (size.x - halfWidth) * random.nextDouble(), | ||||
|             halfHeight + (size.y - halfHeight) * random.nextDouble(), | ||||
|             (size.x / 2) * random.nextDouble() * (random.nextBool() ? 1 : -1), | ||||
|             (size.y / 2) * random.nextDouble() * (random.nextBool() ? 1 : -1), | ||||
|           ), | ||||
|         ), | ||||
|       ), | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Lukas Klingsbo
					Lukas Klingsbo