Added velocity component to cube

This commit is contained in:
2025-12-24 11:15:42 +01:00
parent ce3e08c1e7
commit 70a155903e

View File

@@ -1,7 +1,7 @@
use bevy::prelude::*; // Core Bevy types use bevy::prelude::*; // Core Bevy types
const GRAVITY: f32 = -20.0; const GRAVITY: f32 = -0.981;
const CAMERA_SPEED: f32 = 5.0; // units per second const CAMERA_SPEED: f32 = 20.0; // units per second
fn main() { fn main() {
App::new() App::new()
@@ -29,6 +29,7 @@ fn setup(
Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))), Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))),
MeshMaterial3d(materials.add(Color::srgb_u8(124, 144, 255))), MeshMaterial3d(materials.add(Color::srgb_u8(124, 144, 255))),
Transform::from_xyz(0.0, 0.5, 0.0), Transform::from_xyz(0.0, 0.5, 0.0),
Velocity(vec3(0.0, 2.0, 0.0)),
)); ));
// light // light
commands.spawn(( commands.spawn((