Showing results for

ecs

on bfnightly.bracketproductions.com
bfnightly.bracketproductions.com › chapter 73.html
Systems/Dispatch - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { impl State { fn run_systems(&mut self) { self.dispatcher.run_now(&mut self.ecs); self.ecs.maintain(); } } }
If you cargo run...
bfnightly.bracketproductions.com › chapter 71.html
Logging - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { pub fn inflict_damage(ecs: &mut World, damage: &EffectSpawner, target: Entity) { let mut pools = ecs.write_storage::<Pools>(); let player_entity = ecs...
bfnightly.bracketproductions.com › chapter 57a.html
Spatial Indexing Revisited - Roguelike Tutorial - In Rust
...i32, ecs: &mut World) -> RunState { let mut positions = ecs.write_storage::<Position>(); let players = ecs.read_storage::<Player>(); let mut viewsheds = ecs.write_storage::<Viewshed>(); let entities...
bfnightly.bracketproductions.com › chapter 58.html
Item Stats and Vendors - Roguelike Tutorial - In Rust
...VendorMode) -> (VendorResult, Option<Entity>, Option<String>, Option<f32>) { let player_entity = gs.ecs.fetch::<Entity>(); let names = gs.ecs.read_storage::<Name>(); let backpack = gs.ecs...
bfnightly.bracketproductions.com › chapter 57.html
Better AI - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { fn skip_turn(ecs: &mut World) -> RunState { let player_entity = ecs.fetch::<Entity>(); let viewshed_components = ecs.read_storage::<Viewshed>(); let factions = ecs...
bfnightly.bracketproductions.com › chapter 50.html
Game Stats - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { pub fn player(ecs : &mut World, player_x : i32, player_y : i32) -> Entity { ecs .create_entity() .with(Position { x: player_x, y: player_y...
bfnightly.bracketproductions.com › chapter 21.html
REX Paint Menu - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { gs.ecs.insert(rex_assets::RexAssets::new()); }
Now we open up gui.rs
and find the main_menu
function. We'll...
bfnightly.bracketproductions.com › chapter 59.html
Deep caverns - Roguelike Tutorial - In Rust
...#![allow(unused)] fn main() { gui::CheatMenuResult::Heal => { let player = self.ecs.fetch::<Entity>(); let mut pools = self.ecs.write_storage::<Pools>(); let mut player_pools...
bfnightly.bracketproductions.com › chapter 53.html
Into the Woods! - Roguelike Tutorial - In Rust
...Vec<(Entity, Position)> = Vec::new(); let entities = ecs.entities(); let mut equipped = ecs.write_storage::<Equipped>(); let mut carried = ecs.write_storage::<InBackpack>(); let mut positions...
bfnightly.bracketproductions.com › chapter 43.html
Section 4 - Making A Game - Roguelike Tutorial - In Rust
...we might introduce friendly NPCs.
- Monsters are similar to players - the ECS helps with this, since we're simulating the player in the same...