Issue fixed, but not in the ideal way. I'm working on that.
This commit is contained in:
parent
3b266b2169
commit
8d147ad1df
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
@ -67,14 +67,14 @@ try:
|
||||||
|
|
||||||
def clicked_card(x, y):
|
def clicked_card(x, y):
|
||||||
"""
|
"""
|
||||||
:return: The card which was clicked
|
Appends the card which was clicked on to the list clicked_cards.
|
||||||
"""
|
"""
|
||||||
Audio.click()
|
|
||||||
global clicked_cards
|
global clicked_cards
|
||||||
|
if len(clicked_cards) == 2:
|
||||||
|
return None
|
||||||
|
Audio.click()
|
||||||
for card in cards:
|
for card in cards:
|
||||||
if card.is_mouse_over(x, y) and card.shape()[:10] != 'card_front':
|
if card.is_mouse_over(x, y) and card.shape()[:10] != 'card_front':
|
||||||
if len(clicked_cards) == 2:
|
|
||||||
clicked_cards = []
|
|
||||||
card.to_front()
|
card.to_front()
|
||||||
clicked_cards.append(card)
|
clicked_cards.append(card)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue