|
@@ -1,21 +1,6 @@ |
|
|
import arcade |
|
|
import arcade |
|
|
from desktop_Platform import * |
|
|
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): |
|
|
def desktop_createDeselectedTiles(p): |
|
|
for (id, pos) in enumerate(p.c.tilePositions): |
|
|
for (id, pos) in enumerate(p.c.tilePositions): |
|
|
tile = arcade.AnimatedTimeBasedSprite() |
|
|
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 |
|
|
# Hide deselected tile and show selected one |
|
|
# |
|
|
# |
|
|
# Conditions: |
|
|
# Conditions: |
|
@@ -73,13 +73,40 @@ def desktop_hideMatchingTiles(p): |
|
|
if ( |
|
|
if ( |
|
|
p.c.recentField == "hideMatchingTiles" |
|
|
p.c.recentField == "hideMatchingTiles" |
|
|
): |
|
|
): |
|
|
for id in p.c.hiddenItems: |
|
|
|
|
|
|
|
|
for id in p.c.selectedItems: |
|
|
p.deselectedTiles[id].visible = False |
|
|
p.deselectedTiles[id].visible = False |
|
|
p.selectedTiles[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 |
|
|
# Postpone hiding of matching tiles for better UX |
|
|
# |
|
|
# |
|
|
# Conditions: |
|
|
# Conditions: |
|
|