mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 00:17:20 +08:00
Fix collision detection and rendering of local shape angles (#773)
* Fix collision detection with anchor other than center * Fix rotation around anchor * Simplify advanced collision detection example * Add some tests * Simplify multiple shapes example more * Move shapeCenter logic into Shape * Render center point * More debugging in MultipleShapes * Wtf. * Re-add "possibly" calculation * Rotate shape around parent center * Only consider the parent center * Format multiple shapes example * Add simple shapes example * Add caching in polygon * Fix rendering of polygon shapes * Remove print * Add changelog entry * Fix analyze complaints * Remove all shapes that contain the pressed point * Take zoom into consideration in multiple shapes example * Remove useless import * map instead of generate * Fix position component test * Simpler negative vector2 * "Correct" format * Add ShapeComponent instead of camera aware shapes * Fix formatting * Remove zoom from collision detection example * No need for gameRef in MultipleShapes example * Fix naming in only_shapes
This commit is contained in:
@ -4,6 +4,7 @@ import 'package:flame/game.dart';
|
||||
import '../../commons/commons.dart';
|
||||
import 'circles.dart';
|
||||
import 'multiple_shapes.dart';
|
||||
import 'only_shapes.dart';
|
||||
|
||||
void addCollisionDetectionStories(Dashbook dashbook) {
|
||||
dashbook.storiesOf('Collision Detection')
|
||||
@ -16,5 +17,10 @@ void addCollisionDetectionStories(Dashbook dashbook) {
|
||||
'Multiple shapes',
|
||||
(_) => GameWidget(game: MultipleShapes()),
|
||||
codeLink: baseLink('collision_detection/multiple_shapes.dart'),
|
||||
)
|
||||
..add(
|
||||
'Shapes without components',
|
||||
(_) => GameWidget(game: OnlyShapes()),
|
||||
codeLink: baseLink('collision_detection/only_shapes.dart'),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user