Something went wrong. Try again.
🎠 Powerfull and simple 2D game engine with ecs based on raylib forked from vyacheslavhere.tngl.sh/carousel
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445use carousel::{ core::{ Game, State, settings::{ ClockSettings, DebugSettings, DrawSettings, PhysicsSettings, Settings, StageSettings, WindowSettings, }, }, draw::color::Color, stage::basic::{Position, Scale, Sprite},};use std::path::PathBuf;
struct MyGame;impl Game for MyGame { fn start(&mut self, ctxt: &mut carousel::core::ctxt::Ctxt) { let texture = ctxt .texture(PathBuf::from("examples/assets/squirrel.png")) .unwrap(); let _ = ctxt .world .entity() .with(Position(360, 240)) .with(Scale(0.05)) .with(Sprite(texture)); }
fn update(&mut self, _: &mut carousel::core::ctxt::Ctxt) {}}
fn main() { let game = MyGame; let mut state = State::new( game, Settings::new( ClockSettings::new(30.0), WindowSettings::new("Debug", 720, 480), StageSettings::new(DrawSettings::new(Color::WHITE)), PhysicsSettings::default(), DebugSettings, ), ); state.start_game();}