From 4ebff662acf3a81c418c0c4c7b8abd7025c3044dbde5bb99e114ddad46201a61 Mon Sep 17 00:00:00 2001 From: Stef Date: Wed, 24 Dec 2025 10:31:04 +0100 Subject: [PATCH] Added setup system. Spawns two balls which are rendered correctly. --- app/src/main.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main.rs b/app/src/main.rs index 304eb2e..c9dd56c 100644 --- a/app/src/main.rs +++ b/app/src/main.rs @@ -1,7 +1,21 @@ -use bevy::prelude::*; +use bevy::color::palettes::basic::RED; +use bevy::prelude::*; // Core Bevy types + fn main() { App::new() .add_plugins(DefaultPlugins) + .add_systems(Startup, setup) .run(); } + +fn setup(mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>) { + + commands.spawn(Camera2d); + + let shape =meshes.add(Circle::new(50.0)); + + commands.spawn((Mesh2d(shape.clone()), MeshMaterial2d(materials.add(Color::from(RED))), Transform::from_xyz(100.0, 0.0, 0.0))); + + commands.spawn((Mesh2d(shape.clone()), MeshMaterial2d(materials.add(Color::from(RED))), Transform::from_xyz(0.0, 0.0, 0.0))); +} \ No newline at end of file