3 releases (breaking)
0.2.0 | Aug 2, 2023 |
---|---|
0.1.1 | May 25, 2023 |
0.0.1 | May 23, 2023 |
#1134 in Game dev
29 downloads per month
22KB
138 lines
Bevy Health System
Version Tracker
Bevy | bevy_health_system |
---|---|
0.11 | 0.2.0 |
0.10 | 0.1.1 |
Table of contents
- What is bevy health system
- Design Goals
- Useful Links
- Quick Start
- How to remove bevy
- Examples
- LICENSE
What is bevy_health_system
An easy way to add a health system to your bevy's entity.
NOTICE: This package is not entirely depend on bevy, the only "bevy thing" this package use is the Component struct. This is described in: NO BEVY section.
Design Goals
- Simple: Easy to pick up, flexible and easy to extend.
- Capable: Any idea of health system can implement this system.
Useful Links
- Documentation - Docrs: https://docs.rs/bevy_health_system/latest/bevy_health_system/
- Download - Crates: https://crates.io/crates/bevy_health_system
- Repository - Github: https://github.com/thaiminh2022/bevy_health_system
Quick Start
- Import the
HealthSystem
struct. - Add
HealthSystem
struct just like any component for your entity.
use bevy::prelude::*
use bevy_health_system::HealthSystem
fn spawn_player(mut commands: Commands) {
commands.spawn(HealthSystem::new(100.0));
}
No Bevy
Explanation
This package is not entirely depend on bevy, the only "bevy thing" this package use is the Component struct.
use bevy::prelude::Component;
How to remove Bevy
If you want to use this package independently with bevy, here's what to do.
- Go to "src/lib"
- Copy HealthSystem struct and its implementation to your rust code.
- Remove the Component trait.
Examples
I'm too lazy to add examples, check the docs. Should be easy to implement to your projects.
LICENSE
MIT
Dependencies
~20–29MB
~468K SLoC