mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-31 17:06:50 +08:00 
			
		
		
		
	Fix hitbox circle on flip (#1165)
This commit is contained in:
		| @ -39,13 +39,12 @@ class MyCollidable extends PositionComponent | ||||
|           position: position, | ||||
|           size: Vector2.all(100), | ||||
|           anchor: Anchor.center, | ||||
|         ) { | ||||
|     addHitbox(HitboxCircle()); | ||||
|   } | ||||
|         ); | ||||
|  | ||||
|   @override | ||||
|   Future<void> onLoad() async { | ||||
|     await super.onLoad(); | ||||
|     addHitbox(HitboxCircle()); | ||||
|     final center = gameRef.size / 2; | ||||
|     velocity = (center - position)..scaleTo(150); | ||||
|   } | ||||
|  | ||||
| @ -10,6 +10,7 @@ | ||||
|  - Fix `Parallax.load` with different loading times | ||||
|  - Fix render order of components and add tests | ||||
|  - `isHud` renamed to `respectCamera` | ||||
|  - Fix `HitboxCircle` when component is flipped | ||||
|  | ||||
| ## [1.0.0-releasecandidate.18] | ||||
|  - Forcing portrait and landscape mode is now supported on web | ||||
|  | ||||
| @ -43,7 +43,8 @@ class Circle extends Shape { | ||||
|     _scaledSize | ||||
|       ..setFrom(size) | ||||
|       ..multiply(scale); | ||||
|     return (min(_scaledSize.x, _scaledSize.y) / 2) * normalizedRadius; | ||||
|     return (min(_scaledSize.x.abs(), _scaledSize.y.abs()) / 2) * | ||||
|         normalizedRadius; | ||||
|   } | ||||
|  | ||||
|   /// This render method doesn't rotate the canvas according to angle since a | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Lukas Klingsbo
					Lukas Klingsbo