do a basic scene and way too much organization and fail to implement panning

This commit is contained in:
Schrottkatze 2025-05-14 23:14:41 +02:00
parent 08069c9224
commit 6d269d0c14
Signed by: schrottkatze
SSH key fingerprint: SHA256:FPOYVeBy3QP20FEM42uWF1Wa/Qhlk+L3S2+Wuau/Auo
6 changed files with 156 additions and 29 deletions

25
src/game/scene.rs Normal file
View file

@ -0,0 +1,25 @@
use bevy::prelude::*;
use crate::cleanup;
const NORMALSPUR: f32 = 1.435;
pub fn setup(
mut c: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
// spawn in floor plane
c.spawn((
Mesh3d(meshes.add(Plane3d::default().mesh().size(128., 128.))),
MeshMaterial3d(materials.add(Color::srgb(0.3, 0.8, 0.4))),
cleanup::Scene,
));
// track (temporary)
c.spawn((
Mesh3d(meshes.add(Cuboid::new(NORMALSPUR, 0.25, 96.))),
MeshMaterial3d(materials.add(Color::BLACK)),
cleanup::Scene,
));
}