Fix faster diagonal acceleration for the player
All checks were successful
CI / Formatting (push) Successful in 1m27s

Also always accelerate the player using the same force, so that bigger players aren't overpowered.
This commit is contained in:
Michael Bradley 2025-05-24 00:43:44 -04:00
parent 10b525e4c7
commit 0896ccf691
Signed by: MichaelBradley
SSH key fingerprint: SHA256:o/aaeYtRubILK7OYYjYP12DmU7BsPUhKji1AgaQ+ge4
3 changed files with 41 additions and 18 deletions

View file

@ -6,9 +6,13 @@ use bevy::prelude::*;
#[require(Collider, Mesh2d, MeshMaterial2d<ColorMaterial>, Restitution = Restitution::new(1.0), RigidBody, TransformInterpolation, Transform)]
struct GameObject;
/// Radius of a ball
#[derive(Component, Default)]
pub struct Radius(pub f32);
/// A basic ball with which to interact
#[derive(Component, Default)]
#[require(GameObject, RigidBody = RigidBody::Dynamic)]
#[require(GameObject, RigidBody = RigidBody::Dynamic, Radius)]
pub struct Ball;
/// The controllable ball