how to play is mostly good

main
Elijah Voigt 1 year ago
parent f8bed3111f
commit c587dd6f6f

@ -185,6 +185,7 @@ fn setup_how_to_play(mut commands: Commands, deck: Res<Deck>) {
.observe(button_set_state(ViewState::Menu));
parent.spawn((Node {
width: Val::Px(500.0),
align_items: AlignItems::Center,
justify_content: JustifyContent::Center,
flex_direction: FlexDirection::Column,
@ -255,16 +256,17 @@ fn setup_how_to_play(mut commands: Commands, deck: Res<Deck>) {
);
[
("Find groups of 3 cards", None),
("All cards in a set must match or differ in their traits: Color, Number, Shading, and Shape.", None),
("All cards in a set must either match or differ in their traits: Color, Number, Shading, and Shape.", None),
("For example all agree on Color, Shading, and Shape but not Number...", Some(most_matching)),
("...or all agree on Number but not Color, Number, Shading, and Shape...", Some(most_not_matching)),
("...but never partial agreement on a trait...", Some(not_valid)),
("...or all agree on Number but not Color, Shading, and Shape...", Some(most_not_matching)),
("...but never partial agreement...", Some(not_valid)),
("When in doubt, click the 'Help!' button to get an assist.", None),
]
.iter()
.for_each(|(t, example)| {
parent.spawn((
Node {
max_width: Val::Percent(100.0),
flex_direction: FlexDirection::Row,
align_items: AlignItems::Center,
..default()
@ -278,6 +280,9 @@ fn setup_how_to_play(mut commands: Commands, deck: Res<Deck>) {
},
Text(t.to_string()),
));
parent.spawn(Node {
..default()
}).with_children(|parent| {
if let Some((a, b, c)) = example {
[a, b, c].iter().for_each(|x| {
let sprite = deck.cards.get(*x).unwrap();
@ -298,6 +303,7 @@ fn setup_how_to_play(mut commands: Commands, deck: Res<Deck>) {
});
});
});
});
}
fn setup_deck(mut commands: Commands) {

Loading…
Cancel
Save