# Commits

committed d8bebe2

Working on issue 6

• Participants
• Parent commits ab57216
• Branches master

# File pypong-clock/ball.py

`             self.rect.left = (self.surface.get_width()/2)`
`             #set the new velocity to a random between initial and max`
`             self.velocity[0] = random.randint(self._initial_velocity[0], MAX_HORIZONTAL_VELOCITY)`
`-            self.velocity[1] = random.randint(self._initial_velocity[1], MAX_VERTICAL_VELOCITY)`
`+            self.velocity[1] = -1 * abs(random.randint(self._initial_velocity[1], MAX_VERTICAL_VELOCITY))`
`             self.velocity[0] *= -1.0  # change direction`
`             self.need_updated_intercept_position = True`
`             self.point_scored('left')`
`             self.rect.left = (self.surface.get_width()/2)   `
`             #set the new velocity to a random between initial and max`
`             self.velocity[0] = random.randint(self._initial_velocity[0], MAX_HORIZONTAL_VELOCITY)`
`-            self.velocity[1] = random.randint(self._initial_velocity[1], MAX_VERTICAL_VELOCITY)`
`+            self.velocity[1] = -1 * abs(random.randint(self._initial_velocity[1], MAX_VERTICAL_VELOCITY))`
`             #self.velocity[0] *=	-1  #change direction`
`             #print 'right player score - ball exited at: ' + str(t_position.top)`
`             self.point_scored('right')`

`         t_position = pygame.Rect((self._rect.left, self._rect.top + self.velocity, self._rect.width, self._rect.height))`
` `
`         #only stop moving if we will move above the top or bottom edge and tracking beneath or above it`
`-        if t_position.top <= self.play_area.top and \`
`-                                self.track_to_position - self._rect.height / 2  < self.play_area.top:`
`+        # for #6 changed boundary check to greater than rather than greater than or equal this allows paddle`
`+        # to travel further up.`
`+        if t_position.top < self.play_area.top and \`
`+                                self.track_to_position - self._rect.height / 2 < self.play_area.top:`
`             turn_velocity = self.play_area.top - self._rect.top  # move next to border`
`             at_boundary = True`
` `
`-        if t_position.bottom >= self.play_area.top + self.play_area.height \`
`+        if t_position.bottom > self.play_area.top + self.play_area.height \`
`             and self.track_to_position + self._rect.height / 2 > \`
`                                 self.play_area.top + self.play_area.height:`
`             turn_velocity = self.play_area.top + self.play_area.height - self._rect.bottom`

# File pypong-clock/pypong-clock.py

`     now = datetime.datetime.now()`
`     hour = now.strftime("%I")`
` `
`+    # Working on Issue # 6`
`+    if left_score.score > int(hour):`
`+        right_score.reset_score()`
`+        left_score.reset_score()`
`+        CAN_RESET_HOUR = False`
`+        return`
`+`
`     if left_score.score < int(hour):`
`         right_paddle.allow_score()`
`         return`