add bevy
This commit is contained in:
parent
4d96dd8987
commit
683e17f76f
1 changed files with 42 additions and 0 deletions
42
technology/dev/programming/frameworks/Bevy.md
Normal file
42
technology/dev/programming/frameworks/Bevy.md
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
obj: concept
|
||||||
|
website: https://bevyengine.org
|
||||||
|
repo: https://github.com/bevyengine/bevy
|
||||||
|
---
|
||||||
|
|
||||||
|
# Bevy Engine
|
||||||
|
Bevy is a modern, open-source game engine built in **Rust**. It emphasizes simplicity, modularity, and performance, making it an attractive choice for game developers looking for a data-driven, Entity-Component-System (ECS) architecture combined with modern rendering capabilities.
|
||||||
|
|
||||||
|
## Entity Component System (ECS)
|
||||||
|
|
||||||
|
* **Entity:** Unique identifier representing a game object.
|
||||||
|
* **Component:** Plain data attached to entities.
|
||||||
|
* **System:** Logic operating on entities with matching components, executed in parallel where possible.
|
||||||
|
|
||||||
|
This design promotes separation of data and logic, enabling highly efficient, cache-friendly processing.
|
||||||
|
|
||||||
|
## Basic Example
|
||||||
|
|
||||||
|
A simple example creating a window and spawning a 2D sprite:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
App::new()
|
||||||
|
.add_plugins(DefaultPlugins)
|
||||||
|
.add_startup_system(setup)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
|
// Camera
|
||||||
|
commands.spawn(Camera2dBundle::default());
|
||||||
|
|
||||||
|
// Sprite
|
||||||
|
commands.spawn(SpriteBundle {
|
||||||
|
texture: asset_server.load("branding/icon.png"),
|
||||||
|
..Default::default()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
Loading…
Add table
Add a link
Reference in a new issue