flame_behaviors 1.2.0 copy "flame_behaviors: ^1.2.0" to clipboard
flame_behaviors: ^1.2.0 copied to clipboard

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

example/lib/main.dart

import 'package:example/behaviors/behaviors.dart';
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame_behaviors/flame_behaviors.dart';
import 'package:flutter/material.dart';

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

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

    return super.onLoad();
  }
}

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

Publisher

verified publisherverygood.ventures

Weekly Downloads

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

Repository (GitHub)
View/report issues
Contributing

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flame, flutter

More

Packages that depend on flame_behaviors