Merge branch 'main' into interaction

This commit is contained in:
lorrens
2025-04-05 22:18:58 +02:00
committed by GitHub
9 changed files with 96 additions and 7792 deletions

View File

@@ -1,12 +1,12 @@
use asset_loading::ImageAssets;
use bevy::prelude::*;
use bevy_rapier3d::prelude::*;
mod asset_loading;
mod bevy_plugin;
mod interaction;
mod level_instantiation;
mod main_menu;
mod physics;
mod player;
mod util;
@@ -20,6 +20,8 @@ fn main() {
level_instantiation::map_plugin,
player::plugin,
interaction::plugin,
RapierPhysicsPlugin::<NoUserData>::default(),
RapierDebugRenderPlugin::default(),
))
.init_state::<GameState>()
.add_systems(OnEnter(GameState::Playing), setup)
@@ -52,11 +54,17 @@ fn setup(
MeshMaterial3d(materials.add(Color::WHITE)),
Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2)),
));
commands.spawn((
RigidBody::Fixed,
Collider::cylinder(0.1, 4.0)
));
// cube
commands.spawn((
Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))),
MeshMaterial3d(materials.add(Color::srgb_u8(124, 144, 255))),
Transform::from_xyz(3.0, 0.5, 0.0),
RigidBody::Fixed,
Collider::cuboid(0.5, 0.5, 0.5),
));
// light
commands.spawn((