Skip to content
fledge-frameworkPublic

About

No description, website, or topics provided.

Resources

Contributing

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Fledge

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

License

Overview

Fledge brings the power of modern ECS architecture to Flutter, enabling you to build performant 2D games with clean, composable code. Inspired by Bevy, Fledge separates data (components) from logic (systems) for maximum flexibility and testability.

Features

  • Entity Component System — Compose game objects from reusable components
  • System Scheduling — Automatic parallel execution with dependency resolution, fixed-timestep support, and an ordering-ambiguity checker
  • Two-World Architecture — Separate game logic from rendering via extractors and a dedicated render world
  • Real Canvas Rendering — Sprite pipeline built on Canvas.drawRawAtlas with layer-sorted draws
  • Ref-counted Assets — Shared Handle<T> + Assets<T> store used by render, audio, tiled
  • 2.5D Primitives — Orthographic, isometric, and oblique projections; camera follow, shake, letterbox, parallax
  • Dynamic Lighting — Point / directional / spot lights and ambient illumination
  • Retained-mode HUD/UI — Anchor-based layout, containers, text, images, panels
  • Debug Tooling — Runtime overlay (FPS, entity count, ordering ambiguities) plus AABB / collider / camera-frustum gizmos
  • Plugin System — Modular, reusable game features
  • Action-Based Input — Map physical inputs to semantic actions
  • Spatial Audio — 2D positional audio with volume channels
  • Tiled Integration — Load and render TMX/TSX tilemaps
  • Yarn Dialogue — Branching dialogue with variables and commands
  • Physics & Collision — Layer-based collision detection and resolution
  • Save System — File-based save/load with versioning
  • Game Calendar — Day/night cycles, seasons, curfew
  • Multiplayer Networking — Encrypted host/client transport with state sync and input prediction

Packages

Core

Package Description pub.dev
fledge_ecs Core ECS framework pub
fledge_ecs_annotations Annotations for code generation pub
fledge_ecs_generator Code generator for components/systems pub
fledge_assets Ref-counted asset store pub

Render

Package Description pub.dev
fledge_render_2d 2D rendering + core render infrastructure pub
fledge_camera_2d Cameras, follow, shake, letterbox, parallax pub
fledge_particles CPU-driven particle system pub
fledge_lighting_2d Dynamic 2D lighting pub
fledge_tween Easing curves and value tweens pub
fledge_ui Retained-mode HUD/UI pub
fledge_debug Overlay + gizmos pub

Plugins

Package Description pub.dev
fledge_input Action-based input handling pub
fledge_audio Music and sound effects pub
fledge_window Window management pub
fledge_tiled Tiled tilemap support pub
fledge_yarn Yarn Spinner dialogue system pub
fledge_physics Physics and collision detection pub
fledge_save Save/load system with versioning pub
fledge_calendar Game calendar and day/night cycles pub
fledge_net Multiplayer networking pub

Quick Start

Add Fledge to your project:

dependencies:
  fledge_ecs: ^0.2.1

Create your first ECS app:

import 'package:fledge_ecs/fledge_ecs.dart';

// Components are plain Dart classes
class Position {
  double x, y;
  Position(this.x, this.y);
}

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

// Systems operate on component queries
class MovementSystem extends System {
  @override
  SystemMeta get meta => SystemMeta(
    name: 'movement',
    writes: {ComponentId.of<Position>()},
    reads: {ComponentId.of<Velocity>()},
    resourceReads: {WallTime},
  );

  @override
  Future<void> run(World world) async {
    final time = world.getResource<WallTime>()!;
    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 {
  final app = App()
    ..addPlugin(WallTimePlugin())
    ..addSystem(MovementSystem());

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

  // Run the game loop
  await app.run();
}

Documentation

Visit fledge-framework.dev for:

Examples

See the examples directory for complete sample projects.

Development

This monorepo uses Melos for package management:

# Install melos
dart pub global activate melos

# Bootstrap all packages
melos bootstrap

# Run tests across all packages
melos run test

# Analyze all packages
melos run analyze

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

License

Apache 2.0 - See LICENSE for details.

About

No description, website, or topics provided.

Resources

Contributing

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages