game/
game.rs

1use fennel_engine::{
2    ecs::sprite::Sprite, app::AppBuilder
3};
4use specs::{Builder, WorldExt};
5
6#[tokio::main]
7async fn main() -> anyhow::Result<()> {
8    let mut app = AppBuilder::new()
9        .name("game")
10        .dimensions((800, 800))
11        .config("fennel-engine/examples/game.toml")
12        .build()
13        .unwrap();
14
15    app
16        .world
17        .create_entity()
18        .with(Sprite {
19            image: String::from("assets/example.png"),
20            position: (100.0, 100.0)
21        })
22        .build();
23
24    app
25        .world
26        .create_entity()
27        .with(Sprite {
28            image: String::from("assets/example.png"),
29            position: (300.0, 100.0)
30        })
31        .build();
32
33    app.run().await?;
34    Ok(())
35}