Beispiel #1
0
 def resetDeadWoodstocks(self):
     for w in self.woodstocks:
         # Woodstock is dead if he hits the bottom or if Snoopy catches him
         if w.isAtBottomEdge() or w.hasCollidedWith(self.snoopy):
             if(w.hasCollidedWith(self.snoopy)):
                 self.score += 1
             vspeed = w.vspeed
             rspeed = w.rspeed
             self.woodstocks.remove(w)
             w = Woodstock(self)
             w.setVSpeed(vspeed)
             w.setRSpeed(rspeed)
             self.woodstocks.append(w)
Beispiel #2
0
 def resetDeadWoodstocks(self):
     for w in self.woodstocks:
         # Woodstock is dead if he hits the bottom or if Snoopy catches him
         if w.isAtBottomEdge() or w.hasCollidedWith(self.snoopy):
             if (w.hasCollidedWith(self.snoopy)):
                 self.score += 1
             vspeed = w.vspeed
             rspeed = w.rspeed
             self.woodstocks.remove(w)
             w = Woodstock(self)
             w.setVSpeed(vspeed)
             w.setRSpeed(rspeed)
             self.woodstocks.append(w)
Beispiel #3
0
    def createWoodstocks(self):
        # There is one woodstock for each speed
        # The first one is vertical speed. Second one is the rotational speed
        speeds = [(4,10), (8,20), (12,30), (16, 40)]
        woodstocks = []

        for speedPair in speeds:
            speed, rspeed = speedPair
            w = Woodstock(self)
            w.setVSpeed(speed)
            w.setRSpeed(rspeed)
            woodstocks += [w]

        return woodstocks
Beispiel #4
0
    def createWoodstocks(self):
        # There is one woodstock for each speed
        # The first one is vertical speed. Second one is the rotational speed
        speeds = [(4, 10), (8, 20), (12, 30), (16, 40)]
        woodstocks = []

        for speedPair in speeds:
            speed, rspeed = speedPair
            w = Woodstock(self)
            w.setVSpeed(speed)
            w.setRSpeed(rspeed)
            woodstocks += [w]

        return woodstocks