flame-engine / forge2d

A Dart port of Box2D
BSD 3-Clause "New" or "Revised" License
181 stars 26 forks source link

Error: 'Viewport' is imported from both 'package:flame/src/game/viewport.dart' and 'package:flame_forge2d/viewport.dart'. #19

Closed gustav0 closed 3 years ago

gustav0 commented 3 years ago

Hi, I just started using forge2d and I can't manage to get it running. This literally happens on an empty project. My code is just:

// main.dart
void main() {
  runApp(GameWidget(game: MyGame()));
}
// game.dart
class MyGame extends Forge2DGame {} // This works if I use flame's BaseGame instead.

My dependencies look like this:

// pubspec.yaml

dependencies:
  # other stuff
  flame: ^1.0.0-rc7  # tried removing this
  forge2d: ^0.6.5  # tried removing this
  flame_forge2d: ^0.6.4-rc4

I'm kinda new to dart/flutter, so I actually have no idea what's the todo here.

spydon commented 3 years ago

Hi, flame_forge2d isn't ported to be able to use flame rc7 yet, so you'll have to use rc6 until later this week when the update to rc8 is done.

And also, you don't have to import forge2d as a dependency, that is handled by flame_forge2d.

gustav0 commented 3 years ago

@spydon Thank you. That fixed it.