flame_behaviors 2.0.0-dev.0 copy "flame_behaviors: ^2.0.0-dev.0" to clipboard
flame_behaviors: ^2.0.0-dev.0 copied to clipboard

Flame Behaviors applies separation of concerns to game logic in the form of Entities and Behaviors, originally built by Very Good Ventures.

example/lib/main.dart

import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame_behaviors/flame_behaviors.dart';
import 'package:flame_behaviors_example/behaviors/behaviors.dart';
import 'package:material_ui/material_ui.dart';

class ExampleGame extends FlameGame with EntityMixin, HasCollisionDetection {
  @override
  Future<void> onLoad() async {
    add(FpsTextComponent(position: Vector2.zero()));
    add(ScreenHitbox());

    // Game-specific behaviors
    add(SpawningBehavior());

    return super.onLoad();
  }
}

void main() {
  runApp(GameWidget(game: ExampleGame()));
}
34
likes
160
points
2.1k
downloads

Documentation

API reference

Publisher

verified publisherflame-engine.org

Weekly Downloads

Flame Behaviors applies separation of concerns to game logic in the form of Entities and Behaviors, originally built by Very Good Ventures.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

flame, flutter

More

Packages that depend on flame_behaviors