fledge_ecs 0.1.10 copy "fledge_ecs: ^0.1.10" to clipboard
fledge_ecs: ^0.1.10 copied to clipboard

A Bevy-inspired Entity Component System (ECS) for Dart and Flutter game development.

fledge_ecs #

A Bevy-inspired Entity Component System (ECS) for Dart and Flutter game development.

pub package

Features #

  • Entities & Components: Spawn entities and attach pure data components
  • Systems: Define game logic that operates on component queries
  • Resources: Share global state across systems
  • Events: Communicate between systems with typed events
  • Plugins: Bundle related functionality into reusable modules
  • Scheduling: Control system execution order with stages

Installation #

dependencies:
  fledge_ecs: ^0.1.0

Quick Start #

import 'package:fledge_ecs/fledge_ecs.dart';

// Define components (pure data)
class Position {
  double x, y;
  Position(this.x, this.y);
}

class Velocity {
  double x, y;
  Velocity(this.x, this.y);
}

// Define a system
class MovementSystem extends System {
  @override
  SystemMeta get meta => SystemMeta(
    name: 'movement',
    reads: {ComponentId.of<Velocity>()},
    writes: {ComponentId.of<Position>()},
    resourceReads: {Time},
  );

  @override
  Future<void> run(World world) async {
    final time = world.getResource<Time>()!;
    for (final (_, pos, vel) in world.query2<Position, Velocity>().iter()) {
      pos.x += vel.x * time.delta;
      pos.y += vel.y * time.delta;
    }
  }
}

void main() async {
  // Create the app
  final app = App()
    ..addPlugin(TimePlugin())
    ..addSystem(MovementSystem());

  // Spawn an entity
  app.world.spawn()
    ..insert(Position(0, 0))
    ..insert(Velocity(10, 5));

  // Run the game loop
  while (true) {
    await app.tick();
  }
}

Documentation #

Package Description
fledge_render Core rendering infrastructure
fledge_render_2d 2D sprites, cameras, animation
fledge_input Action-based input handling
fledge_audio Music and sound effects
fledge_window Window management
fledge_tiled Tiled tilemap support

License #

Apache 2.0 - See LICENSE for details.

0
likes
160
points
384
downloads

Publisher

verified publisherfledge-framework.dev

Weekly Downloads

A Bevy-inspired Entity Component System (ECS) for Dart and Flutter game development.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#ecs #game-engine #game-development #entity-component-system #flutter-games

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

fledge_ecs_annotations, meta

More

Packages that depend on fledge_ecs