Skip to content

Instantly share code, notes, and snippets.

@karl-zylinski
Last active August 29, 2015 13:55
Show Gist options
  • Save karl-zylinski/8772190 to your computer and use it in GitHub Desktop.
Save karl-zylinski/8772190 to your computer and use it in GitHub Desktop.
fn main() {
let mut layers = ~[
~GameLayer::new(&mut resource_store) as ~Layer:,
~GuiLayer::new() as ~Layer
];
while window.is_open() {
let mut new_layers: ~[~Layer:] = ~[];
for layer in layers.iter() {
let update_result = layer.update(dt, &input);
new_layers = vec::append(new_layers, update_result.new_layers);
layer.draw(&mut window);
}
layers = new_layers;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment