Python PyGame score counter incrementing by seconds instead of by 1
<p>I'm creating a game where the score should increase by 1 every time that 2 sprites collide. Right now the score appears as 0 to begin and then once the collision happens it increments to 39 (sometimes it's 27. The variability in the number makes me think it's incrementing by seconds). Reading some other answers on here made me realize it's most likely an issue of where I have</p>

<pre><code>t = f.render("Score = " + str(score), False, black) 
screen.blit(t, (0,0))
</code></pre>

<p>located in the for loop. But I have tried putting it elsewhere and then the score does not appear on the screen at all. </p>

<p>here is the part of my code that creates the score</p>

<pre><code>class Tub(Sprite):   
    def __init__(self):
        Sprite.__init__(self)
        self.image = image.load("tub.bmp").convert_alpha()
        self.image = transform.scale(self.image, (100, 100))
        self.rect = self.image.get_rect()
        self.rect.x = width/2
        self.rect.y = height - 100       
    def movement(self):
        keys = pygame.key.get_pressed()
        dist = 5
        if keys [pygame.K_LEFT]:
            self.rect.x -= dist
        if keys [pygame.K_RIGHT]:
            self.rect.x += dist
    def hit(self, target):
        return self.rect.colliderect(target)

class Singlescoop_pink(Sprite):
    def __init__(self):
        Sprite.__init__(self)
        self.image = image.load("singlescoop_pink.bmp").convert_alpha()
        self.image = transform.scale(self.image, (100, 100))
        self.rect = self.image.get_rect()
        self.rect.x = random.randint(0, width-100) #random x position, minus 100 so image does not go off screen
        self.rect.y = -600 #start off screen so starting point to fall down is not visible
    def movement(self):
        self.rect.y += 5
        if self.rect.y &gt; height:
            self.kill()


tub = Tub()
sspink = Singlescoop_pink()
sprites = pygame.sprite.RenderPlain(tub, sspink)
score = 0

def game_loop():

    gameExit = False
    while not gameExit:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                quit()
                sys.exit()

        if tub.hit(sspink):
            sspink.kill()
            global score
            score += 1

        tub.movement()
        sspink.movement()
        screen.fill(white)
        t = f.render("Score = " + str(score), False, black)
        screen.blit(t, (0,0))
        sprites.update()
        sprites.draw(screen)
        display.update()
        clock.tick(60)

game_loop()
</code></pre>