This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
extern crate error_chain; | |
extern crate hlua; | |
extern crate specs; | |
use std::collections::HashMap; | |
error_chain! { | |
errors { | |
NoSuchComponent(name: String) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<'a> System<'a> for EntitiyCreator { | |
type SystemData = (Entities<'a>, WriteStorage<'a, Pos>); | |
fn run(&mut self, (entities, pos): Self::SystemData) { | |
let a = entities.create(); | |
let b = entities.create(); | |
pos.insert(a, Pos::new(2, 4)); | |
pos.insert(b, Pos::new(3, 5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate shred; | |
#[macro_use] | |
extern crate shred_derive; | |
extern crate specs; | |
use shred::{DispatcherBuilder, System}; | |
use specs::{ReadStorage, WriteStorage, World}; | |
use specs::entity::Component; | |
use specs::storages::VecStorage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"meshes": { | |
"cube": "obj", | |
"sphere": "fbx" | |
}, | |
"textures": { | |
"grass": "png", | |
"brick": "jpg" | |
}, |
NewerOlder