Fix scoring
parent
f45632acee
commit
1538609e81
|
@ -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:
|
||||
|
|
4
game.py
4
game.py
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue