You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

use amethyst::{
assets::Processor,
core::transform::TransformBundle,
prelude::*,
renderer::{types::DefaultBackend, RenderingSystem, SpriteSheet},
utils::application_root_dir,
window::WindowBundle,
};
mod render;
mod state;
fn main() -> amethyst::Result<()> {
amethyst::start_logger(Default::default());
let app_root = application_root_dir()?;
let resources = app_root.join("resources");
let display_config = resources.join("display_config.ron");
let render_graph = render::RenderGraph::default();
let render_system = RenderingSystem::<DefaultBackend, _>::new(render_graph);
let game_data = GameDataBuilder::default()
.with_bundle(WindowBundle::from_config_path(display_config))?
.with_bundle(TransformBundle::new())?
.with(
Processor::<SpriteSheet>::new(),
"sprite_sheet_processor",
&[],
)
.with_thread_local(render_system);
let mut game = Application::new(resources, state::MyState, game_data)?;
game.run();
Ok(())
}