i have a way to set a timer for creating new objects copied from a
book but as i have started my next exercise in a very different way, i
want to avoid that math method/formula as it will cause me to
rearrange some classes totally...

i tried a simple method but its not working. any ideas? heres my code,
ill leave out the irrelevant code.

class Game(object):
    interval = 0

    def play(self):
        Game.interval = 40
        while Game.interval > 0:
                    self.count_down()

    def count_down(self):
        Game.interval -= 1

so the play() method gives interval a value of 40. the while loop
should reduce interval by 1 everytime it calls the count_down()
method. The problem is this is happening instantly. i've even put the
Game.interval value as high as 50000 and it reaches 0 instantly.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to