Showing results for

ecs

on bfnightly.bracketproductions.com
bfnightly.bracketproductions.com
Introduction - Roguelike Tutorial - In Rust
...use an Entity Component System. Rust has an excellent one called Specs, so I went with it. I've used ECS-based setups in...
bfnightly.bracketproductions.com › chapter 0.html
Introduction - Roguelike Tutorial - In Rust
...use an Entity Component System. Rust has an excellent one called Specs, so I went with it. I've used ECS-based setups in...
bfnightly.bracketproductions.com › chapter 6.html
Monsters - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { let positions = self.ecs.read_storage::<Position>(); let renderables = self.ecs.read_storage::<Renderable>(); let map = self.ecs.fetch::<Map>(); for...
bfnightly.bracketproductions.com › chapter 2.html
Entities and Components - Roguelike Tutorial - In Rust
...This chapter will introduce the entire of an Entity Component System (ECS), which will form the backbone of the rest of this tutorial. Rust...
bfnightly.bracketproductions.com › chapter 9.html
Items and Inventory - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { fn get_item(ecs: &mut World) { let player_pos = ecs.fetch::<Point>(); let player_entity = ecs.fetch::<Entity>(); let entities = ecs.entities...
bfnightly.bracketproductions.com › chapter 55.html
Backtracking - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { pub fn freeze_level_entities(ecs: &mut World) { // Obtain ECS access let entities = ecs.entities(); let mut positions = ecs.write_storage::<Position...
bfnightly.bracketproductions.com › chapter 63.html
Effects - Roguelike Tutorial - In Rust
...Entity) { match &effect.effect_type { EffectType::Damage{..} => damage::inflict_damage(ecs, effect, target), EffectType::Bloodstain{..} => if let Some(pos) = entity_position(ecs, target) { damage::bloodstain(ecs, pos...
bfnightly.bracketproductions.com › chapter 14.html
Equipment - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { fn dagger(ecs: &mut World, x: i32, y: i32) { ecs.create_entity() .with(Position{ x, y }) .with(Renderable{ glyph: rltk...
bfnightly.bracketproductions.com › chapter 19.html
Hunger Clock - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { match spawn.1.as_ref() { "Goblin" => goblin(ecs, x, y), "Orc" => orc(ecs, x, y), "Health Potion" => health_potion(ecs, x...
bfnightly.bracketproductions.com › chapter 72.html
Text Layers - Roguelike Tutorial - In Rust
...i32) -> (ItemMenuResult, Option<Point>) { let (min_x, max_x, min_y, max_y) = camera::get_screen_bounds(&gs.ecs, ctx); let player_entity = gs.ecs.fetch::<Entity>(); let player_pos = gs.ecs...