I’m new to pygame and I wanted to know a way to make my “Points: 0” not disappear every time the rectangle collides(Pontos: 0 means points:0 in English)
exemplifying what I said all I wanted to know is how to make the Point: 0 Don’t disappear the first time and stay fixed on the screen until the game ends
if Rect_player.colliderect(Begim_Rum): screen.blit(text,(60,60)) Begin_ColorShape = ((0,0,0)) Y -= 990
if you have a lack of information, just talk.
begin_rum would be the cube that will start the game.and making the text appear
Rect_Player would be the player that will touch Begin_Rum making the text appear
The text is just drawn if
Rect_player collides with
Begim_Rum and the condition is fulfilled. If you want to make the text permanent, you need to draw it in the application loop.
Add a state variable
draw_text and set the state when the objects collide. Draw the text depending on the state of
draw_text = False # application loop while True: # [...] if Rect_player.colliderect(Begim_Rum): draw_text = True Begin_ColorShape = ((0,0,0)) Y -= 990 # [...] if draw_text: screen.blit(text,(60,60)) # [...] pygame.display.update()