Added some comments

master
David Raison 2014-08-31 03:44:49 +02:00
parent 9c24f74930
commit 9a6954ac8a
2 changed files with 15 additions and 0 deletions

10
game.py
View File

@ -188,6 +188,16 @@ class TheGame:
pinnedAvocados += [avo for avo in movingAvocados if avo.isPinned() ] pinnedAvocados += [avo for avo in movingAvocados if avo.isPinned() ]
movingAvocados[:] = [ avo for avo in movingAvocados if avo.isFalling() ] movingAvocados[:] = [ avo for avo in movingAvocados if avo.isFalling() ]
##############################
#
# Late-Night-Comments:
#
# Can we maybe handle the pinned avocados the same way I handle "stuck"
# pins? It seems to be easier.. well, the pins don't fall out of the screen
# though…
#
##############################
# Now redraw our avocados # Now redraw our avocados
for a in movingAvocados: for a in movingAvocados:
a.setTargetColor(color) a.setTargetColor(color)

View File

@ -31,10 +31,15 @@ class Generate:
def moveTowardsTarget(self): def moveTowardsTarget(self):
##############################
#
# Late-Night-Comments:
#
# OK, this works, but honestly, # OK, this works, but honestly,
# it would probably be much more effective # it would probably be much more effective
# to just be more lenient on isStuck # to just be more lenient on isStuck
# e.g. accept approximate positions. # e.g. accept approximate positions.
###############################
x, y = self.pos x, y = self.pos
tx, ty = self.target tx, ty = self.target
xToCover = tx - x; xToCover = tx - x;