mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-31 08:56:01 +08:00 
			
		
		
		
	fix: Remove deprecations for 1.10.0 (#2809)
Removed deprecations for 1.10.0 and fixes some small unreleased regressions found when going through the examples.
This commit is contained in:
		| @ -1,5 +1,6 @@ | ||||
| import 'package:examples/commons/ember.dart'; | ||||
| import 'package:flame/components.dart'; | ||||
| import 'package:flame/events.dart'; | ||||
| import 'package:flame/experimental.dart'; | ||||
| import 'package:flame/extensions.dart'; | ||||
| import 'package:flame/game.dart'; | ||||
| @ -10,19 +11,23 @@ class SpawnComponentExample extends FlameGame with TapDetector { | ||||
|   static const String description = | ||||
|       'Tap on the screen to start spawning Embers within different shapes.'; | ||||
|  | ||||
|   SpawnComponentExample() : super(world: SpawnComponentWorld()); | ||||
| } | ||||
|  | ||||
| class SpawnComponentWorld extends World with TapCallbacks { | ||||
|   @override | ||||
|   void onTapDown(TapDownInfo info) { | ||||
|   void onTapDown(TapDownEvent info) { | ||||
|     final shapeType = Shapes.values.random(); | ||||
|     final Shape shape; | ||||
|     final position = info.eventPosition.game; | ||||
|     final position = info.localPosition; | ||||
|     switch (shapeType) { | ||||
|       case Shapes.rectangle: | ||||
|         shape = Rectangle.fromCenter( | ||||
|           center: info.eventPosition.game, | ||||
|           center: position, | ||||
|           size: Vector2.all(200), | ||||
|         ); | ||||
|       case Shapes.circle: | ||||
|         shape = Circle(info.eventPosition.game, 150); | ||||
|         shape = Circle(position, 150); | ||||
|       case Shapes.polygon: | ||||
|         shape = Polygon( | ||||
|           [ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Lukas Klingsbo
					Lukas Klingsbo