Skip to content

Commit

Permalink
Update pygame.examples.go_over_there for Python 3.12
Browse files Browse the repository at this point in the history
Python 3.12 function `random.randint()` expects integer arguments only. The go_over_there example was passing a float as the second argument.
  • Loading branch information
llindstrom committed Oct 16, 2023
1 parent e3d34b4 commit 516ad4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/go_over_there.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def reset():
balls = []
for x in range(MAX_BALLS):
pos = pygame.Vector2(
random.randint(0, SCREEN_SIZE.x), random.randint(0, SCREEN_SIZE.y)
random.randint(0, int(SCREEN_SIZE.x)), random.randint(0, int(SCREEN_SIZE.y))
)
speed = random.uniform(MIN_SPEED, MAX_SPEED)

Expand Down

0 comments on commit 516ad4d

Please sign in to comment.