Files
flame/examples/lib/stories/collision_detection/collision_detection.dart
RutvikTak b1a6dd18f2 docs: Added bouncing ball example in collision_detection examples and updated flame_forge2d to latest (#1868)
This PR adds two updates.

It updates the flame_forge2d to latest version i.e on pub.dev in examples and padracing projects.

Adds a bouncing ball example in the collision detection examples demonstrating a simple example of collision and bouncing of a ball from the walls around it.
2022-08-29 09:34:33 +00:00

58 lines
2.2 KiB
Dart

import 'package:dashbook/dashbook.dart';
import 'package:examples/commons/commons.dart';
import 'package:examples/stories/collision_detection/bouncing_ball_example.dart';
import 'package:examples/stories/collision_detection/circles_example.dart';
import 'package:examples/stories/collision_detection/collidable_animation_example.dart';
import 'package:examples/stories/collision_detection/multiple_shapes_example.dart';
import 'package:examples/stories/collision_detection/raycast_example.dart';
import 'package:examples/stories/collision_detection/raycast_light_example.dart';
import 'package:examples/stories/collision_detection/raytrace_example.dart';
import 'package:flame/game.dart';
void addCollisionDetectionStories(Dashbook dashbook) {
dashbook.storiesOf('Collision Detection')
..add(
'Collidable AnimationComponent',
(_) => GameWidget(game: CollidableAnimationExample()),
codeLink:
baseLink('collision_detection/collidable_animation_example.dart'),
info: CollidableAnimationExample.description,
)
..add(
'Circles',
(_) => GameWidget(game: CirclesExample()),
codeLink: baseLink('collision_detection/circles_example.dart'),
info: CirclesExample.description,
)
..add(
'Bouncing Ball',
(_) => GameWidget(game: BouncingBallExample()),
codeLink: baseLink('collision_detection/bouncing_ball_example.dart'),
info: BouncingBallExample.description,
)
..add(
'Multiple shapes',
(_) => GameWidget(game: MultipleShapesExample()),
codeLink: baseLink('collision_detection/multiple_shapes_example.dart'),
info: MultipleShapesExample.description,
)
..add(
'Raycasting (light)',
(_) => GameWidget(game: RaycastLightExample()),
codeLink: baseLink('collision_detection/raycast_light_example.dart'),
info: RaycastLightExample.description,
)
..add(
'Raycasting',
(_) => GameWidget(game: RaycastExample()),
codeLink: baseLink('collision_detection/raycast_example.dart'),
info: RaycastExample.description,
)
..add(
'Raytracing',
(_) => GameWidget(game: RaytraceExample()),
codeLink: baseLink('collision_detection/raytrace.dart'),
info: RaytraceExample.description,
);
}