|  |  | @ -311,73 +311,74 @@ fn initialize(mut commands: Commands, board: Res<game::Board>, assets: Res<Asset | 
			
		
	
		
		
			
				
					
					|  |  |  |                         start: 0.0, |  |  |  |                         start: 0.0, | 
			
		
	
		
		
			
				
					
					|  |  |  |                         duration: 12.0, |  |  |  |                         duration: 12.0, | 
			
		
	
		
		
			
				
					
					|  |  |  |                     }, // Marks pieces as dissolving
 |  |  |  |                     }, // Marks pieces as dissolving
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 )); |  |  |  |                 )) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                 .with_children(|parent| { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 // Hitboxes
 |  |  |  |                     // Hitboxes
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 game::tiles().for_each(|(index, tile)| { |  |  |  |                     game::tiles().for_each(|(index, tile)| { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     let side = Board::side(index).expect("Spawn valid side"); |  |  |  |                         let side = Board::side(index).expect("Spawn valid side"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     parent.spawn(( |  |  |  |                         parent.spawn(( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         DisplayState::Display3d, |  |  |  |                             DisplayState::Display3d, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         Display3d, |  |  |  |                             Display3d, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         index, |  |  |  |                             index, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         tile, |  |  |  |                             tile, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         PbrBundle { |  |  |  |                             PbrBundle { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             mesh: assets.hitbox_shape.clone(), |  |  |  |                                 mesh: assets.hitbox_shape.clone(), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             material: assets.hitbox_material.clone(), |  |  |  |                                 material: assets.hitbox_material.clone(), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             visibility: Visibility::Hidden, |  |  |  |                                 visibility: Visibility::Hidden, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             ..default() |  |  |  |                                 ..default() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         }, |  |  |  |                             }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         side, |  |  |  |                             side, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         game::Selectable, |  |  |  |                             game::Selectable, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     )); |  |  |  |                         )); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 }); |  |  |  |                     }); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 // Valid move indicators
 |  |  |  |                     // Valid move indicators
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 game::tiles().for_each(|(index, _)| { |  |  |  |                     game::tiles().for_each(|(index, _)| { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     let side = Board::side(index).expect("Spawn valid side"); |  |  |  |                         let side = Board::side(index).expect("Spawn valid side"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     parent.spawn(( |  |  |  |                         parent.spawn(( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         DisplayState::Display3d, |  |  |  |                             DisplayState::Display3d, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         Display3d, |  |  |  |                             Display3d, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         index, |  |  |  |                             index, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         SceneBundle { |  |  |  |                             SceneBundle { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             visibility: Visibility::Hidden, |  |  |  |                                 visibility: Visibility::Hidden, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             transform: Transform::from_translation(board_translation(&index)), |  |  |  |                                 transform: Transform::from_translation(board_translation(&index)), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             ..default() |  |  |  |                                 ..default() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         }, |  |  |  |                             }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         side, |  |  |  |                             side, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         game::ValidMove, |  |  |  |                             game::ValidMove, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     )); |  |  |  |                         )); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 }); |  |  |  |                     }); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 // Pieces
 |  |  |  |                     // Pieces
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 let mut angle = 0.0; |  |  |  |                     let mut angle = 0.0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 board.pieces().iter().for_each(|(index, piece)| { |  |  |  |                     board.pieces().iter().for_each(|(index, piece)| { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     let side = Board::side(*index).expect("Spawn valid side"); |  |  |  |                         let side = Board::side(*index).expect("Spawn valid side"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     // Rotates each piece 90 degrees offset from the previous piece
 |  |  |  |                         // Rotates each piece 90 degrees offset from the previous piece
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     let rotation = Quat::from_rotation_y(angle); |  |  |  |                         let rotation = Quat::from_rotation_y(angle); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     let transform = Transform::default().with_rotation(rotation); |  |  |  |                         let transform = Transform::default().with_rotation(rotation); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     angle += std::f32::consts::PI / 2.0; |  |  |  |                         angle += std::f32::consts::PI / 2.0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     parent.spawn(( |  |  |  |                         parent.spawn(( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         side, |  |  |  |                             side, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         DisplayState::Display3d, |  |  |  |                             DisplayState::Display3d, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         Display3d, |  |  |  |                             Display3d, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         *piece, |  |  |  |                             *piece, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         *index, |  |  |  |                             *index, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         SceneBundle { |  |  |  |                             SceneBundle { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             visibility: Visibility::Hidden, |  |  |  |                                 visibility: Visibility::Hidden, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             transform, |  |  |  |                                 transform, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             ..default() |  |  |  |                                 ..default() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         }, |  |  |  |                             }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         game::Selectable, |  |  |  |                             game::Selectable, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         Dissolvable { |  |  |  |                             Dissolvable { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             start: 1.0, |  |  |  |                                 start: 1.0, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             duration: 3.0, |  |  |  |                                 duration: 3.0, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         }, // Marks pieces as dissolving
 |  |  |  |                             }, // Marks pieces as dissolving
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     )); |  |  |  |                         )); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     }); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 }); |  |  |  |                 }); | 
			
		
	
		
		
			
				
					
					|  |  |  |         }); |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | @ -1267,6 +1268,7 @@ fn continue_title(mut next_state: ResMut<NextState<GameState>>) { | 
			
		
	
		
		
			
				
					
					|  |  |  | fn dissolve_animation( |  |  |  | fn dissolve_animation( | 
			
		
	
		
		
			
				
					
					|  |  |  |     mut query: Query<(Entity, &Dissolvable, &mut Dissolving, &mut Visibility)>, |  |  |  |     mut query: Query<(Entity, &Dissolvable, &mut Dissolving, &mut Visibility)>, | 
			
		
	
		
		
			
				
					
					|  |  |  |     children: Query<&Children>, |  |  |  |     children: Query<&Children>, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     // Used to create Handle<DissolveMaterial>
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     mut dissolve_materials: ResMut<Assets<DissolveMaterial>>, |  |  |  |     mut dissolve_materials: ResMut<Assets<DissolveMaterial>>, | 
			
		
	
		
		
			
				
					
					|  |  |  |     object_materials: Query<(Entity, &Handle<DissolveMaterial>)>, |  |  |  |     object_materials: Query<(Entity, &Handle<DissolveMaterial>)>, | 
			
		
	
		
		
			
				
					
					|  |  |  |     mut commands: Commands, |  |  |  |     mut commands: Commands, | 
			
		
	
	
		
		
			
				
					|  |  | 
 |