Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert user when trying to make an invalid pickup #25

Open
dliberat opened this issue Oct 5, 2018 · 0 comments
Open

Alert user when trying to make an invalid pickup #25

dliberat opened this issue Oct 5, 2018 · 0 comments

Comments

@dliberat
Copy link
Owner

dliberat commented Oct 5, 2018

If the user attempts to pick up a combination of cards that is invalid, they should receive some sort of visual feedback to alert them.

The following method in game_frame.py checks the validity of the pickup:

    def play_hand(self, hand_card):
        """Callback function executed when
        player clicks the "Play Hand" button.
        """
        if self.ronda.current_player is self.player:
            print(f"Attempting to play {hand_card} and\
                pick up: {self.selected_table_cards}")

            if is_valid_pickup(hand_card, self.selected_table_cards):
                self.ronda = self.ronda.play_turn(hand_card,
                                                  self.selected_table_cards)
                self.draw()
                self.play_next_move()
        else:
            print("not your turn")

Specifically, we can see that the if is_valid_pickup line does not have an else statement associated with it.

As for a specific implementation, at the moment I'm thinking that flashing something like this might be a good idea, but if someone wants to tackle this issue and has some other visual implementation in mind, it would be more than welcome.

screen shot 2018-10-05 at 12 30 33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant