|
|
@@ -1,21 +1,6 @@ |
|
|
|
import arcade |
|
|
|
from desktop_Platform import * |
|
|
|
|
|
|
|
def desktop_loadTextures(p): |
|
|
|
texs = [] |
|
|
|
for (id, td) in enumerate(p.c.textureDescriptions): |
|
|
|
tex = arcade.load_texture( |
|
|
|
td.fileName, |
|
|
|
x = td.x, |
|
|
|
y = td.y, |
|
|
|
width = td.width, |
|
|
|
height = td.height |
|
|
|
) |
|
|
|
texs.append(tex) |
|
|
|
#} |
|
|
|
p.textures = texs |
|
|
|
#} |
|
|
|
|
|
|
|
def desktop_createDeselectedTiles(p): |
|
|
|
for (id, pos) in enumerate(p.c.tilePositions): |
|
|
|
tile = arcade.AnimatedTimeBasedSprite() |
|
|
@@ -51,6 +36,21 @@ def desktop_createSelectedTiles(p): |
|
|
|
#} |
|
|
|
#} |
|
|
|
|
|
|
|
# Deselect mismatched tiles |
|
|
|
# |
|
|
|
# Conditions: |
|
|
|
# 1. Time to deselect mismatched items |
|
|
|
def desktop_deselectMismatchedTiles(p): |
|
|
|
if ( |
|
|
|
p.c.recentField == "deselectMismatchedTiles" |
|
|
|
): |
|
|
|
for id in p.c.mismatchedItems: |
|
|
|
p.deselectedTiles[id].visible = True |
|
|
|
p.selectedTiles[id].visible = False |
|
|
|
#} |
|
|
|
#} |
|
|
|
#} |
|
|
|
|
|
|
|
# Hide deselected tile and show selected one |
|
|
|
# |
|
|
|
# Conditions: |
|
|
@@ -73,13 +73,40 @@ def desktop_hideMatchingTiles(p): |
|
|
|
if ( |
|
|
|
p.c.recentField == "hideMatchingTiles" |
|
|
|
): |
|
|
|
for id in p.c.hiddenItems: |
|
|
|
for id in p.c.selectedItems: |
|
|
|
p.deselectedTiles[id].visible = False |
|
|
|
p.selectedTiles[id].visible = False |
|
|
|
#} |
|
|
|
#} |
|
|
|
#} |
|
|
|
|
|
|
|
def desktop_loadTextures(p): |
|
|
|
texs = [] |
|
|
|
for (id, td) in enumerate(p.c.textureDescriptions): |
|
|
|
tex = arcade.load_texture( |
|
|
|
td.fileName, |
|
|
|
x = td.x, |
|
|
|
y = td.y, |
|
|
|
width = td.width, |
|
|
|
height = td.height |
|
|
|
) |
|
|
|
texs.append(tex) |
|
|
|
#} |
|
|
|
p.textures = texs |
|
|
|
#} |
|
|
|
|
|
|
|
# Postpone deselection of mismatched tiles for better UX |
|
|
|
# |
|
|
|
# Conditions: |
|
|
|
# 1. a pair of tiles has been mismatched |
|
|
|
def desktop_scheduleDeselectionOfMismatchedTiles(p): |
|
|
|
if ( |
|
|
|
p.c.recentField == "mismatchedItems" |
|
|
|
): |
|
|
|
p.sequentialTimer.schedule("deselectMismatchedTiles", True, p.c.deselectMismatchedTilesDelay) |
|
|
|
#} |
|
|
|
#} |
|
|
|
|
|
|
|
# Postpone hiding of matching tiles for better UX |
|
|
|
# |
|
|
|
# Conditions: |
|
|
|