So yes i have been making this game for a while know and i have allways done detecting buttons and other clikable objects by using:
defined at start ones:
system1 = pygame.draw.rect(screen, red, (500+spacemove_x, 500+spacemove_y, 40, 35), 0) ###make rect
this is in loop
if system1.collidepoint(ship_x,ship_y):
print("hello")
Know that does not work at all? But if i put...
system1 = pygame.draw.rect(screen, red, (500+spacemove_x, 500+spacemove_y, 40, 35), 0)
if system1.collidepoint(ship_x,ship_y):
print("hello")
but that works but it keeps bugging the game like that red square keeps blinking on the screen and i dont want system1 = pygame.draw.rect(screen, red, (500+spacemove_x, 500+spacemove_y, 40, 35), 0)
to be in loop.
what causes this and why? and how can i fix this?