Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- from pygame import Vector2, Rect
- from pygame.locals import *
- WHITE = 16777215
- BLACK = 0
- pygame.init()
- PDR = Rect(0, 0, 1280, 720)
- PDS = pygame.display.set_mode(PDR.size)
- degrees = 0
- radius = 150
- exit_demo = False
- while not exit_demo:
- for e in pygame.event.get():
- if e.type == KEYUP and e.key == K_ESCAPE:
- exit_demo = False
- mp = pygame.mouse.get_pos()
- crosshair_pos = Vector2(mp) + Vector2(1, 0).rotate(degrees) * radius
- degrees += 1
- PDS.fill(BLACK)
- pygame.draw.line(PDS, WHITE, crosshair_pos - (0, 25), crosshair_pos + (0, 25))
- pygame.draw.line(PDS, WHITE, crosshair_pos - (25, 0), crosshair_pos + (25, 0))
- pygame.display.update()
- pygame.time.Clock().tick(120)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement