diff --git a/src/main.rs b/src/main.rs index c2be6e9..6f4ee68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,33 @@ use bevy::prelude::*; +#[derive(Component)] +struct SnakeHead; + +const SNAKE_HEAD_COLOR: Color = Color::srgb(0.7, 0.7, 0.7); + fn main() { App::new() .add_plugins(DefaultPlugins) - .add_systems(Startup, setup_camera) + .add_systems(Startup, (setup_camera, spawn_snake)) .run(); } fn setup_camera(mut commands: Commands) { - commands.spawn(Camera2dBundle {..default()}); + commands.spawn(Camera2dBundle { ..default() }); +} + +fn spawn_snake(mut commands: Commands) { + commands + .spawn(SpriteBundle { + sprite: Sprite { + color: SNAKE_HEAD_COLOR, + ..default() + }, + transform: Transform { + scale: Vec3::new(10.0, 10.0, 10.0), + ..default() + }, + ..default() + }) + .insert(SnakeHead); }