Skip to content
Sign upLog in
← Back to Community


Profile icon

Hello there! time to see a rainbow! To do this you need to open a new repl. Then click Pygame if you already used Pygame. You can also type in Pygame if you want. Then write import pygame

when youur done, you need to choose a background. It should look like this screen = pygame.display.set_mode([800,600])

background_color = (0,102,255)

Great! Now we have the color of the sky!
You can also do this if you want a white background, screen = pygame.display.set_mode([800,600])

background_color = (255,255,255)

To repeat it you need to use a while True:. Then you need to make the circles so the code should look like this, (255,0,0), (400,400), 350), (255,145,0), (400,400), 300), (255,255,0), (400,400), 250), (0,255,0), (400,400), 200), (0,0,255), (400,400), 150), (205,0,255), (400,400), 100), (0,102,255), (400,400), 50).
You can add a sun if you'd like one and if you do the code should look like this, (255,255,0), (50,50), 50). The next step is to make a rectangle to cover one half of the circle. You should make it green so it's going to represent the grass. It should look like this
The ending should be like this pygame.display.update()
There! You're all done with the rainbow!
It's a pretty picture! Do you agree with me?

Profile icon
Profile icon
Profile icon