79597124

Date: 2025-04-28 18:56:56
Score: 0.5
Natty:
Report link

I think your problem is because your vector is rotating around its origin, and that is (0, 0), so you'll need to add up the two vectors, and you don't need to increase the rotating angle, as that makes the clock spin faster and faster.

This is how I implemented it in code:

import pygame, sys
from pygame import Vector2

pygame.init()
screen = pygame.display.set_mode((500, 500))
clock = pygame.time.Clock()
SCREEN_UPDATE = pygame.USEREVENT
pygame.time.set_timer(SCREEN_UPDATE, 100)

vector = Vector2(250, 100)
center = Vector2(250, 200)

while True:
    for event in pygame.event.get():

        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

        if event.type == SCREEN_UPDATE:
            vector.rotate_ip(1)


    screen.fill('black')
    pygame.draw.line(screen, 'white', center, center+vector)

    pygame.display.flip()
    clock.tick(60)

Please correct me if I am wrong.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user30033510