import pygame
dx = 3
dy = 4
x = 100
y = 100
radius = 20
pygame.init()
clock = pygame.time.Clock()
display = pygame.display.set_mode((500, 300), pygame.SRCALPHA, 32)
while True:
clock.tick(30)
for event in pygame.event.get():
mouseX = event.pos(0)
mouseY = event.pos(1)
if event.type == pygame.MOUSEBUTTONDOWN:
if distance((mouseX, mouseY), (x,y)) <= radius:
dx = dx+sign(dx)
dy = dy+sign(dy)
score = score + 1
else:
exit()
t = font.render ("Score: "+str(score), 1, (255,255,255))
display.blit (t, (20,20))
display.fill((100, 100, 100))
x = x + dx
y = y + dy
pygame.draw.circle (display, (200,200,200), (x,y), radius)
if (x< radius or x>500- radius):
dx = -dx
if (y< radius) or (y>300- radius):
dy = -dy
pygame.display.update()```
it keeps showing up this error:```
File "d:\Code\Jet Boat.py", line 18 if event.type == pygame.MOUSEBUTTONDOWN: ^ IndentationError: unindent does not match any outer indentation level
What am I doing wrong here? Can someone explain?
where am i supposed to intend? And what does intend mean?
or am i supposed to remove the if from if event.type == pygame.MOUSEBUTTONDOWN:
?