mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	feat: Children as argument to FlameGame (#1680)
Since we have already added children as an argument to Component, this adds it to the FlameGame.
This commit is contained in:
		| @ -9,16 +9,15 @@ class PriorityExample extends FlameGame with HasTappables { | ||||
|     the priority. | ||||
|   '''; | ||||
|  | ||||
|   @override | ||||
|   Future<void> onLoad() async { | ||||
|     final squares = [ | ||||
|       Square(Vector2(100, 100)), | ||||
|       Square(Vector2(160, 100)), | ||||
|       Square(Vector2(170, 150)), | ||||
|       Square(Vector2(110, 150)), | ||||
|     ]; | ||||
|     addAll(squares); | ||||
|   } | ||||
|   PriorityExample() | ||||
|       : super( | ||||
|           children: [ | ||||
|             Square(Vector2(100, 100)), | ||||
|             Square(Vector2(160, 100)), | ||||
|             Square(Vector2(170, 150)), | ||||
|             Square(Vector2(110, 150)), | ||||
|           ], | ||||
|         ); | ||||
| } | ||||
|  | ||||
| class Square extends RectangleComponent | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Lukas Klingsbo
					Lukas Klingsbo