Fix scoring

master
Raphaël Vinot 2014-08-31 10:45:06 +02:00
parent f45632acee
commit 1538609e81
2 changed files with 5 additions and 2 deletions

View File

@ -66,6 +66,7 @@ class Avocado:
else:
self.clickFail.play()
return False, (0, 0)
return None, (0, 0)
# BUG - isHit is called 4 times upon click which makes it return the
# first time but fail the consecutive times
#else:

View File

@ -258,12 +258,14 @@ class TheGame:
# Check if any avocados have been hit
for avo in self.movingAvocados:
hit, center = avo.isHit(mousepos)
if hit is None:
continue
if hit:
score += 100
newPin.throwAt(center)
color = self.chooseRandomColor()
crystalBall.setColor(color)
elif hit == False:
else:
score -= 50
# Had enough of this?