Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Oct 30, 2023
1 parent dfabc81 commit 416bbeb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
7 changes: 7 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ command:
environment:
sdk: ">=3.0.0 <4.0.0"
bootstrap:
environment:
sdk: ">=3.0.0 <4.0.0"
dependencies:
meta: ^1.11.0
vector_math: ^2.1.4
Expand Down Expand Up @@ -75,3 +77,8 @@ scripts:
run: melos exec -- dart pub global run webdev serve --release
packageFilters:
scope: forge2d_benchmark

example:
run: melos exec -- dart pub global run webdev serve --release
packageFilters:
scope: forge2d_examples
2 changes: 1 addition & 1 deletion packages/benchmark/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 1.0.0+1
publish_to: 'none'

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
build_runner: ^2.4.5
Expand Down
6 changes: 3 additions & 3 deletions packages/forge2d/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ version: 1.0.0+1
publish_to: 'none'

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
build_runner: ^2.4.5
build_web_compilers: ^4.0.3
forge2d: ^0.11.0

dev_dependencies:
build_runner: ^2.4.5
build_web_compilers: ^4.0.4
flame_lint: ^1.1.1
3 changes: 1 addition & 2 deletions packages/forge2d/example/web/demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract class Demo {
late final DebugDraw debugDraw;

/// Frame count for fps
late final int frameCount;
int frameCount = 0;

/// HTML element used to display the FPS counter
late final Element fpsCounter;
Expand Down Expand Up @@ -96,7 +96,6 @@ abstract class Demo {
// Have the world draw itself for debugging purposes.
world.debugDraw = debugDraw;

frameCount = 0;
fpsCounter = querySelector('#fps-counter')!;
worldStepTime = querySelector('#world-step-time')!;
Timer.periodic(const Duration(seconds: 1), (Timer t) {
Expand Down
4 changes: 2 additions & 2 deletions packages/forge2d/example/web/domino_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DominoTest extends Demo {
{
// Floor
final shape = PolygonShape()..setAsBoxXY(50.0, 10.0);
final fixtureDef = FixtureDef(shape);
final fixtureDef = FixtureDef(shape)..friction = 0.1;

final bd = BodyDef();
bd.position = Vector2(0.0, -10.0);
Expand All @@ -24,7 +24,7 @@ class DominoTest extends Demo {
// Platforms
for (var i = 0; i < 4; i++) {
final shape = PolygonShape()..setAsBoxXY(15.0, 0.125);
final fixtureDef = FixtureDef(shape);
final fixtureDef = FixtureDef(shape)..friction = 0.1;

final bodyDef = BodyDef()..position = Vector2(0.0, 5.0 + 5 * i);
final body = world.createBody(bodyDef);
Expand Down
2 changes: 1 addition & 1 deletion packages/forge2d/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A 2D physics engine for Dart (based on Box2D), also works with the
homepage: https://github.com/flame-engine/forge2d

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
meta: ^1.11.0
Expand Down

0 comments on commit 416bbeb

Please sign in to comment.