mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	added missing height which led to an error otherwise
This commit is contained in:
		| @ -21,17 +21,21 @@ class TiledGame extends BaseGame { | ||||
|   } | ||||
|  | ||||
|   void _addCoinsInMap(TiledComponent tiledMap) async { | ||||
|     final ObjectGroup obj = | ||||
|     final ObjectGroup objGroup = | ||||
|         await tiledMap.getObjectGroupFromLayer("AnimatedCoins"); | ||||
|     if (obj == null) { | ||||
|     if (objGroup == null) { | ||||
|       return; | ||||
|     } | ||||
|     for (TmxObject obj in obj.tmxObjects) { | ||||
|     objGroup.tmxObjects.forEach((TmxObject obj) { | ||||
|       final comp = AnimationComponent( | ||||
|           20.0, 20.0, Animation.sequenced('coins.png', 8, textureWidth: 20)); | ||||
|         20.0, | ||||
|         20.0, | ||||
|         Animation.sequenced('coins.png', 8, | ||||
|             textureWidth: 20, textureHeight: 20), | ||||
|       ); | ||||
|       comp.x = obj.x.toDouble(); | ||||
|       comp.y = obj.y.toDouble(); | ||||
|       add(comp); | ||||
|     } | ||||
|     }); | ||||
|   } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Flavio Diez
					Flavio Diez