Feb-29-2020, 02:15 PM
(This post was last modified: Feb-29-2020, 02:15 PM by noodlespinbot.)
I am trying to get it so every thirty seconds the square disappears and you have to find it by hovering youur mouse over it and can
move it. It is not because of my PC. Since I added:
move it. It is not because of my PC. Since I added:
while not glow:
a = 0
b = 0
c = 0
if Mouse_x == x and mouse_y == y:
pygame.time.delay(300)
glow = True
my code always says not responding. import pygame
pygame.init
spotlight = pygame.display.set_mode((700, 600))
pygame.display.set_caption("Spotlight")
Mouse_x, Mouse_y = pygame.mouse.get_pos()
x = 40
y = 40
vel = 20
a = 255
b = 255
c = 255
glow = True
run = True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
spotlight.fill((0, 0, 0))
while not glow:
a = 0
b = 0
c = 0
if Mouse_x == x and mouse_y == y:
pygame.time.delay(300)
glow = True
while glow:
a = 255
b = 255
c = 255
pygame.time.delay(30000)
glow = False
pygame.draw.rect(spotlight, (a, b, c), (x, y, 20, 20))
pygame.display.update()
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
x -= vel
if keys[pygame.K_RIGHT]:
x+= vel
if keys[pygame.K_UP]:
y-= vel
if keys[pygame.K_DOWN]:
y+= vel
