An implementation of the behavioral composition pattern for Flame. Built by Very Good Ventures πŸ¦„

Overview

Flame Behaviors

Very Good Ventures Very Good Ventures

Developed with πŸ’™ by Very Good Ventures πŸ¦„

ci coverage pub package style: very good analysis License: MIT Powered by Flame


An implementation of the behavioral composition pattern for Flame.


Installation πŸ’»

flutter pub add flame_behaviors

Usage ✨

Behavior

A behavior is a component that defines how an entity behaves. It can be attached to an Entity and handle a specific behavior for that entity.

A behavior can have it's own Components for adding extra functionality related to the behavior. It cannot, however, have its own Behaviors.

// Define a custom behavior by extending `Behavior`.
class CollisionBehavior extends Behavior with CollisionCallbacks {
  CollisionBehavior(this._hitbox) : super(children: [_hitbox]);

  final RectangleHitbox _hitbox;

  @override
  Future<void> onLoad() async {...}

  @override
  @mustCallSuper
  void onCollision(Set<Vector2> intersectionPoints, PositionComponent other) {...}

Entity

The entity is the building block of a game. It represents a visual game object that can hold multiple Behaviors which in turn define how the entity behaves.

// Define a custom entity by extending `Entity`.
class MyEntity extends Entity {
  MyEntity() : super(behaviors: [CollisionBehavior(RectangleHitbox()]);
}
Comments
  • feat: update very good analysis

    feat: update very good analysis

    Description

    feat: update very good analysis

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by renancaraujo 1
  • refactor!: make the entity into a generic component

    refactor!: make the entity into a generic component

    Description

    Closes #33

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [x] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by wolfenrain 0
  • refactor: make the entity into a generic component

    refactor: make the entity into a generic component

    Description

    Right now behaviors can't be composed on top of non-positioned components, but there is no reason that an entity has to be a positioned component.

    We should refactor the internal logic to allow for behaviors to be composed onto anything that is a form of entity (and not just a position component).

    opened by wolfenrain 0
  • feat: add dependabot

    feat: add dependabot

    Description

    feat: add dependabot

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by renancaraujo 0
  • chore: move into mono repo

    chore: move into mono repo

    Description

    Move everything in a mono repo in preparation of tha future

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [x] πŸ—‘οΈ Chore
    opened by wolfenrain 0
  • chore: fix typo in CONTRIBUTING.md

    chore: fix typo in CONTRIBUTING.md

    Description

    • chore: fix typo in CONTRIBUTING.md

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [X] πŸ—‘οΈ Chore
    chore 
    opened by felangel 0
  • feat: update version constraints

    feat: update version constraints

    Description

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by wolfenrain 0
  • docs: add missing word to the pong text

    docs: add missing word to the pong text

    Description

    Found the missing word!

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [x] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by wolfenrain 0
  • ci: use semantic-pull-request workflow

    ci: use semantic-pull-request workflow

    Description

    • ci: use semantic-pull-request workflow

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [X] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by felangel 0
  • chore: v0.1.1

    chore: v0.1.1

    Description

    • chore: v0.1.1

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [X] πŸ—‘οΈ Chore
    chore 
    opened by felangel 0
  • fix: `PropagatingCollisionBehavior` should also work for non entity components

    fix: `PropagatingCollisionBehavior` should also work for non entity components

    Description

    Closes #19

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [x] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [ ] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by wolfenrain 0
  • docs: rework docs into its own directory

    docs: rework docs into its own directory

    Description

    Reworking the documentation to be more useful and structured.

    Closes #25

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] πŸ› οΈ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] βœ… Build configuration change
    • [x] πŸ“ Documentation
    • [ ] πŸ—‘οΈ Chore
    opened by wolfenrain 0
  • refactor: convert input behaviors to the new APIs once they hit stable.

    refactor: convert input behaviors to the new APIs once they hit stable.

    Description

    The input behaviors, like DraggableBehavior and TappableBehavior are using the old input system. There is now a (experimental) new API for handing drag and tap events:

    Ones these hit as stable we should refactor these behaviors to work with the new API. This will introduce a breaking change in flame_behaviors.

    Requirements

    • [ ] Refactor input behaviors to the new API
    • [ ] Test their functionality
    • [ ] Write migration documentation
    enhancement 
    opened by wolfenrain 0
  • feat: add an abstract `ScreenCollisionBehavior` to interact with a `ScreenHitbox`

    feat: add an abstract `ScreenCollisionBehavior` to interact with a `ScreenHitbox`

    Description

    @renancaraujo mentioned in https://github.com/VeryGoodOpenSource/flame_behaviors/pull/20#discussion_r901742664 that it would be nice to provide a behavior that simplifies collision interaction with a ScreenHitbox. We should provide an abstract API for that, that people can extend from to implement their own if I hit the screen then do this logic.

    Requirements

    • [ ] An API that allows developers to interact with the ScreenHitbox from a behavior.
    • [ ] Add tests that ensure this new API works as expected.
    opened by wolfenrain 0
Releases(v0.1.1)
Owner
Very Good Open Source
Open source code from Very Good Ventures (@VGVentures)
Very Good Open Source
A Very Good Dart Package Template created by the Very Good Ventures Team πŸ¦„

Very Good Dart Package Developed with ?? by Very Good Ventures ?? A Very Good Dart package created by Very Good Ventures ?? . Getting Started ?? Insta

Very Good Open Source 8 Aug 14, 2022
A Very Good Flutter Package Template created by the Very Good Ventures Team πŸ¦„

Very Good Flutter Package Developed with ?? by Very Good Ventures ?? A Very Good Flutter package created by Very Good Ventures ?? . Getting Started ??

Very Good Open Source 32 Dec 13, 2022
A Very Good Dart CLI Template created by the Very Good Ventures Team πŸ¦„

Very Good Dart CLI Developed with ?? by Very Good Ventures ?? A Dart CLI template created by the Very Good Ventures Team. Generated by the Very Good C

Very Good Open Source 26 Dec 15, 2022
Flame behaviors used to organically manage the movement of an entity. Built by Very Good Ventures πŸ¦„

Steering Behaviors Developed with ?? by Very Good Ventures ?? An implementation of steering behaviors for Flame Behaviors. See Steering Behaviors For

Very Good Open Source 7 Oct 9, 2022
An example Flutter application built with Very Good CLI and Supabase πŸ¦„

Supabase Example Generated by the Very Good CLI ?? An example Flutter application built with Very Good CLI and Supabase ?? Getting Started ?? This pro

Very Good Ventures 46 Dec 27, 2022
A Very Good Blog App using Flutter, flutter_bloc, django rest framework for backend✨

Very Good Blog App - Blog sharing Features Login, register, manage personal information. Compose, edit, post blog to share with everyone. Like, save b

Nguyen Minh Dung 14 Nov 27, 2022
Do more - A good looking glorified todo list built with flutter.

do_more (DO>) A glorified todo list with a beautiful ui. Login with Google Events Organize your tasks by events, visualize them in their page and add

Mariano Uvalle 28 Nov 22, 2022
Bill Splitting App πŸ’΅ with Good UX and Design πŸ‘¨πŸ»β€πŸŽ¨ built with Flutter. πŸš€

Splitty: Bill Splitting App Link Idea ?? Create App where we can create group and add members to share the bill & split the amount equally with member

Dhruvil 2 Sep 6, 2022
Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Jibran Ahmed SiddiQui 9 Oct 29, 2022
Get It - Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App. Maintainer: @escamoteur

❀️ Sponsor get_it This is a simple Service Locator for Dart and Flutter projects with some additional goodies highly inspired by Splat. It can be used

Flutter Community 1k Jan 1, 2023
Find a good meeting time across multiple timezones.

meeting_scheduler Adventures in scheduling across timezones. A project by the Adventures In [Dart, Flutter, Firebase] group. Goals: Help people find a

Adventures In [Dart, Flutter, Firebase] 3 May 23, 2022
Simple and complete Flutter hooks testing utilities that encourage good testing practices.

Flutter Hooks Testing Library Simple and complete Flutter hooks testing utilities that encourage good testing practices. Inspired by react-hooks-testi

Daichi Furiya 24 Dec 2, 2022
Masked text field - A flutter package for masked text field for formet your text and good UI

Masked Text Field Masked Text Field Features A package for masked text field for

Alok Dubey 7 Sep 4, 2022
Notes is a good helper to manage your schedules and notes

Notes is a good helper to manage your schedules and notes. It gives you a quick and simple notepad editing experience when you write notes, memo, email, message, shopping list and to do list. It makes to take a note easier than any other notepad and memo apps.

thejorabek 11 Nov 16, 2022
(RPG maker) Create RPG-style or similar games more simply with Flame.

Bonfire Build RPG games and similar with the power of FlameEngine! Bonfire is ideal for building games from the following perspectives: Test our onlin

Rafael Almeida Barbosa 787 Jan 7, 2023
Store-pattern - The prototype for management applications built with Flutter

Store Pattern ?? The lightweight design pattern for small management applications. Features | Structure | Install | Usage | Documents | Technologies |

UITers 71 Sep 26, 2022