#bevy #flight #gamedev #bullet #transform #component #time

bevy-flights

a small crate for position based flights in the bevy game engine. intended for bullet hells.

2 releases

0.1.2 Jun 20, 2023
0.1.1 Jun 20, 2023
0.1.0 Jun 19, 2023

#1102 in Game dev

Download history 1/week @ 2024-02-14 6/week @ 2024-02-21 2/week @ 2024-02-28 29/week @ 2024-03-27 43/week @ 2024-04-03

72 downloads per month

MIT license

20KB
405 lines

bevy-flights

A crate for handling flying projectiles, especially in bullet-hell games in bevy.

WORK IN PROGRESS


lib.rs:

The purpose of this crate is the modelisation of complex flights that you can find in danmaku games, especially touhou.

How to use:

  • add plugin bevy_flight::prelude::DefaultFlightsPlugin<_>::default() to your app.
  • insert flight components on your bullets such as bevy_flight::flights::AffineFlight2d.

How to create custom flight components:

  • implement trait bevy_flight::flights::FlightDescriptor you are require to implement associated method fn transform(self, t: f32, transform: &mut Transform) where t is usually the elapsed time since the app began given by Res
  • You could also implement another trait such as Translation2dDescriptor thus implementing fn translation(&self, t: f32) -> Vec2 and call .wrap() on it to make it into a component
  • add system bevy_flight::plugin::flight_system::<T> to your app, or if you used Translation2dDescriptor bevy_flight::plugin::position2D_system::<T>
  • insert your custom flight component to your bullets call wrap if necessary.

How to create sums of flights:

  • You may create things like bevy_flights::composites::TranslationSum2d<CircleFlight, LinearFlight> This implements Translation2dDescriptor.
  • Dont forget to add system position2D_system for TranslationSum2d<A, B> Because it's not included in the DefaultFlightsPlugin, even if A and B are. ( that would be impossible anyway, one would have to insert an infinite amount of systems )

Dependencies

~15–25MB
~377K SLoC