diff --git a/app/src/main.rs b/app/src/main.rs index 1ed30ea..3ff8460 100644 --- a/app/src/main.rs +++ b/app/src/main.rs @@ -21,6 +21,9 @@ fn main() { PhysicsPlugins::default(), )) .insert_resource(Time::::default().with_relative_speed(5.0)) + .insert_resource(DefaultRestitution( + Restitution::PERFECTLY_ELASTIC.with_combine_rule(CoefficientCombine::Max), + )) .add_systems(Startup, setup) .add_systems( Update, @@ -75,7 +78,7 @@ fn spawn_ball( commands.spawn(( RigidBody::Dynamic, Collider::circle(CIRCLE_RADIUS), - Restitution::PERFECTLY_ELASTIC.with_combine_rule(CoefficientCombine::Max), + LinearVelocity(Vec2::new(time.elapsed_secs().sin(), time.elapsed_secs().cos()) * 100.0), Mesh2d(meshes.add(Circle::new(CIRCLE_RADIUS))), MeshMaterial2d(materials.add(Color::hsl(time.elapsed_secs().sin() * 360.0, 1.0, 0.5))), Transform::from_xyz(world_position.x, world_position.y, 0.0), diff --git a/build-wasm.sh b/build-wasm.sh index 36a086e..e88ed8b 100755 --- a/build-wasm.sh +++ b/build-wasm.sh @@ -5,7 +5,7 @@ PROFILE="${1:-release}" if [ "$PROFILE" = "dev" ]; then PROFILE_DIR="debug" - CARGO_FLAGS="" + CARGO_FLAGS="--features=bevy/dynamic_linking" else PROFILE_DIR="release" CARGO_FLAGS="--release" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 23674e6..62098d5 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] channel = "1.98.1" -targets = ["wasm32-unknown-unknown", "x86_64-unknown-linux-gnu"] +targets = ["wasm32-unknown-unknown"] components = ["clippy", "rust-analyzer", "rustfmt"]