Technical Team Lead at Health Scholars
Worked in the IT industry for over 15 years
Including contracting at NASA as a systems administrator
Live-coding Rust based projects fun visualizations, and tutorials on Twitch.tv
Game Dev is a different domain
Game Dev is fun*
*your fun amount may vary
Player | Enemy | Tree | Another Enemy | |
---|---|---|---|---|
Location | {x: 100.0, y: 200.0} | {x: 150.0, y: 200.0 | {x: 200.0, y: 750.0} | {x: 450.0, y: 200.0} |
Size | 100.0 | 50.0 | 800.0 | 50.0 |
Health | 100 | 10 | 10 | |
Velocity | {x: 10.0, y: 0.0} | {x: -5.0, y: 0.0} | {x: -5.0, y: 0.0} |
Player | Enemy | Tree | Another Enemy | |
---|---|---|---|---|
Location | {x: 100.0, y: 200.0} | {x: 150.0, y: 200.0 | {x: 200.0, y: 750.0} | {x: 450.0, y: 200.0} |
Size | 100.0 | 50.0 | 800.0 | 50.0 |
Health | 100 | 10 | 10 | |
Velocity | {x: 10.0, y: 0.0} | {x: -5.0, y: 0.0} | {x: -5.0, y: 0.0} |
Player | Enemy | Tree | Another Enemy | |
---|---|---|---|---|
Location | {x: 100.0, y: 200.0} | {x: 150.0, y: 200.0 | {x: 200.0, y: 750.0} | {x: 450.0, y: 200.0} |
Size | 100.0 | 50.0 | 800.0 | 50.0 |
Health | 100 | 10 | 10 | |
Velocity | {x: 10.0, y: 0.0} | {x: -5.0, y: 0.0} | {x: -5.0, y: 0.0} |
00001111 | 00001111 | 00000011 | 00001111 |
---|
Location | 00000001 |
Size | 00000010 |
Health | 00000100 |
Velocity | 00001000 |
fn main() {
let location_mask = 0b00000001;
let size_mask = 0b00000010;
let mut map = 0;
// We insert a location for the entity
map |= location_mask;
dbg!(map);
// Next we insert a size for the entity
map |= size_mask;
dbg!(map);
}
Figure out which entities match the query
Get the components for the matched entities
All without unsafe
*It's really a trait