diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2010-01-03 16:30:55 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2010-01-03 16:30:55 (GMT) |
commit | 0fe16c22d347dc0826a67f71c7aaa9b05d9c4b9c (patch) | |
tree | 15ad10e7713e1e246e1be4bc5de54fc81705cd27 /window.py | |
parent | 15e45ab016df220803bccbf1ab7bae3cd407c44e (diff) |
added easy/hard levels
Diffstat (limited to 'window.py')
-rw-r--r-- | window.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -38,6 +38,8 @@ from deck import * from card import * from sprites import * +difficulty_level = [LOW,HIGH] + class vmWindow: pass # @@ -91,7 +93,7 @@ def new_window(canvas, path, cardtype, parent=None): vmw.match_display_area.append(Card(vmw.sprites, vmw.path, "", vmw.card_width, vmw.card_height, [MATCHMASK,0,0,0])) - vmw.match_display_area[i].spr.x = 10 + vmw.match_display_area[i].spr.x = MATCH_POSITION vmw.match_display_area[i].spr.y = vmw.grid.top+i*vmw.grid.yinc vmw.match_display_area[i].show_card() @@ -111,7 +113,8 @@ def new_game(vmw,cardtype): if vmw.cardtype is not cardtype: vmw.cardtype = cardtype vmw.deck = Deck(vmw.sprites, vmw.path, vmw.cardtype, - vmw.card_width, vmw.card_height) + vmw.card_width, vmw.card_height, + difficulty_level[vmw.level]) vmw.deck.shuffle() vmw.grid.deal(vmw.deck) if find_a_match(vmw) is False: @@ -146,7 +149,7 @@ def _button_release_cb(win, event, vmw): def _process_selection(vmw, spr): # check to make sure a card in the matched pile isn't selected - if spr.x == 10: + if spr.x == MATCH_POSITION: return True # check to make sure that the current card isn't already selected |