Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- pygame.init()
- window = pygame.display.set_mode([800,580])
- X = 200
- Y = 200
- speedX = 1
- speedY = 1
- clock = pygame.time.Clock()
- while True:
- window.fill((255,255,255))
- pygame.draw.circle(
- window,
- [255,0,0],
- [X,Y],
- 70
- )
- X += speedX
- Y += speedY
- if X < 70 or X > 730:
- speedX= -speedX;
- if Y < 70 or Y > 510:
- speedY = -speedY;
- pygame.display.update()
- clock.tick(60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement