mercredi 23 juin 2021

Append or insert random elements to my array

Ok I think I asked the wrong question:

    def draw(self, screen):
        super().draw(screen)

        if self.part == 1:
            screen.blit(self.record_text, (550, 20))
            screen.blit(self.main_image.image, (580, 280)) 
        else:
            # Second half 
            text2 = font.render('¿Qué has visto?',True, PURPLE)
            screen.blit(text2, (400,5))

            # Show all similar images
            cont = 0       
            
            for game_image in self.game_images:
                if cont < 4:
                    
                    game_image.draw(screen)
                cont += 1
            # We associate the correct rect to the correct image, to pass it later to the CORRECT Screen
            self.correct_image_rect = self.game_images[self.game_images.index(self.main_image)].rect

I want to print some images, but this is not reliable, because it doesnt print me the main_image sometimes, and I think the shuffle works as to, it will not print the same first 4 pictures that my folder has.




Aucun commentaire:

Enregistrer un commentaire