Skip to content

Commit 9364724

Browse files
authored
Merge pull request #222 from SCCapstone/final_shops
Added equip functionality
2 parents 5952824 + 1ca0dd5 commit 9364724

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

assets/values.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
global startTime
55
global game_score
66
global coins_in_game
7+
global current_skin
8+
79
# Colors
810
COLOR_Purple = (46, 41, 78)
911
COLOR_Pink = (204, 167, 162)
@@ -27,7 +29,6 @@
2729
SETTING_PATH = "fileio\\UserSetting.json"
2830
"""
2931
summary: draws 3 buttons for screen
30-
3132
Args:
3233
x (int): x size of screen
3334
y (int): y size of screen
@@ -75,6 +76,10 @@ def resetCoinsinGame():
7576
global coins_in_game
7677
coins_in_game = 0
7778

79+
def setSkin(skin):
80+
global current_skin
81+
current_skin = skin
82+
7883

7984
newHighScore = False
8085
newHighScoreId = -1

views/customizeScreen.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,22 @@ def customize_screen(noises, duckIndex, arrayIndex):
339339
)[1] < yArr + hArr:
340340
# Check to see if they have the coins to buy the skin then unlock and select it
341341
noises.playSound("quack")
342-
# Set the duck
343-
retDuck = startingDuck
344-
# Make sure he doesn't have path.join()
345-
values.setDuck(skinNames[retDuck])
342+
# Set the duck to the current one with values.py
343+
# Figure out which array we are currently in
344+
if arrayIndex == 0:
345+
values.setSkin(normalSkins[startingDuck])
346+
elif arrayIndex == 1:
347+
values.setSkin(baseSkins[startingDuck])
348+
elif arrayIndex == 2:
349+
values.setSkin(blueSkins[startingDuck])
350+
elif arrayIndex == 3:
351+
values.setSkin(brownSkins[startingDuck])
352+
elif arrayIndex == 4:
353+
values.setSkin(graySkins[startingDuck])
354+
elif arrayIndex == 5:
355+
values.setSkin(greenSkins[startingDuck])
356+
elif arrayIndex == 6:
357+
values.setSkin(richSkins[startingDuck])
346358

347359
#click on right arrow, move boxes to the right
348360
elif xArr1 + sep + wArr + box + sep < pygame.mouse.get_pos(

0 commit comments

Comments
 (0)