@@ -251,26 +251,30 @@ pub struct ThrusterBundle {
251251
252252impl ThrusterBundle {
253253 pub fn with_color ( p_color : PlayerColor ) -> Self {
254-
255254 ThrusterBundle {
256255 lyon_render : LyonRenderBundle {
257256 shape_render : ShapeBundle {
258257 path : get_path_from_verts ( & THRUSTER_JET , Vec2 :: splat ( 24.0 ) ) ,
259- transform : Transform :: from_rotation ( Quat :: from_rotation_z ( PI ) ) . with_translation ( Vec3 :: new ( 0.0 , -24.0 , 0.0 ) ) ,
258+ transform : Transform :: from_rotation ( Quat :: from_rotation_z ( PI ) )
259+ . with_translation ( Vec3 :: new ( 0.0 , -24.0 , 0.0 ) ) ,
260260 ..default ( )
261261 } ,
262262 stroke : Stroke :: color ( p_color. color ( ) ) ,
263263 fill : Fill :: color ( p_color. color ( ) ) ,
264264 } ,
265265 thruster : Thruster { val : 0.0 } ,
266- replicate : Replication
266+ replicate : Replication ,
267267 }
268268 }
269269}
270270
271- fn handle_thruster ( mut thrusters : Query < ( & mut Transform , & Thruster ) > , time : Res < Time > ) {
271+ fn handle_thruster ( mut thrusters : Query < ( & mut Transform , & Thruster ) > , time : Res < Time > ) {
272272 for ( mut transform, thruster) in thrusters. iter_mut ( ) {
273- transform. scale . y = thruster. val * ( ( time. elapsed_seconds_wrapped ( ) * 20.0 ) . sin ( ) . abs ( ) . clamp ( 0.5 , 1.0 ) ) ;
273+ transform. scale . y = thruster. val
274+ * ( ( time. elapsed_seconds_wrapped ( ) * 20.0 )
275+ . sin ( )
276+ . abs ( )
277+ . clamp ( 0.5 , 1.0 ) ) ;
274278 }
275279}
276280
@@ -412,18 +416,27 @@ pub fn player_actions(
412416 //TODO: There's only one debuff, obviously this needs to be moved to a match at some point
413417 match player. debuff {
414418 Some ( Debuff :: Slowed ) => {
415- if let Some ( ( _parent, mut thruster) ) = thrusters. iter_mut ( ) . find ( |( parent, _thruster) |{ parent. get ( ) == entity} ) {
419+ if let Some ( ( _parent, mut thruster) ) = thrusters
420+ . iter_mut ( )
421+ . find ( |( parent, _thruster) | parent. get ( ) == entity)
422+ {
416423 thruster. val = ( thruster. val - time. delta_seconds ( ) ) . min ( 1.0 ) . max ( 0.0 ) ;
417424 }
418425 }
419426 _ => {
420427 velocity. linvel += forward. xy ( ) * time. delta_seconds ( ) * 50.0 ;
421- if let Some ( ( _parent, mut thruster) ) = thrusters. iter_mut ( ) . find ( |( parent, _thruster) |{ parent. get ( ) == entity} ) {
428+ if let Some ( ( _parent, mut thruster) ) = thrusters
429+ . iter_mut ( )
430+ . find ( |( parent, _thruster) | parent. get ( ) == entity)
431+ {
422432 thruster. val = ( thruster. val + time. delta_seconds ( ) ) . min ( 1.0 ) . max ( 0.0 ) ;
423433 }
424- } ,
434+ }
425435 }
426- } else if let Some ( ( _parent, mut thruster) ) = thrusters. iter_mut ( ) . find ( |( parent, _thruster) |{ parent. get ( ) == entity} ) {
436+ } else if let Some ( ( _parent, mut thruster) ) = thrusters
437+ . iter_mut ( )
438+ . find ( |( parent, _thruster) | parent. get ( ) == entity)
439+ {
427440 thruster. val = ( thruster. val - time. delta_seconds ( ) ) . min ( 1.0 ) . max ( 0.0 ) ;
428441 }
429442 if action_state. pressed ( PlayerAction :: TurnRight ) {
0 commit comments