S
S
shinodaaa2021-07-29 15:13:57
pygame
shinodaaa, 2021-07-29 15:13:57

How to make the point fall?

I set myself the task of making a lot of stars be created and they fall, but I ran into a problem, for 2 days I can’t make the stars themselves fall, I made them to be created at the top of the screen, but I can’t make them fall, now I’m trying to do so that at least one star falls, but it doesn’t work out. Perhaps there is an option to make just a cycle that creates stars (points) a little, it also cannot be done.
ps points that are created are stars, or rather a point.

import pygame
from pygame.locals import *
from tkinter import Tk
import random as rnd
import sys

pygame.init()

t = Tk()

SIZE = WIDTH, HEIGHT = t.winfo_screenwidth(), t.winfo_screenheight()
SIZEM = WIDTH1, HEIGHT1 = rnd.randint(400,900), rnd.randint(100, 200)

WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
PURPLE = (156, 39, 176)
INDIGO = (63, 81, 181)
BLUE = (33, 150, 243)
GREEN = (76, 175, 80)
YELLOW = (255, 235, 59)
ORANGE = (255, 152, 0)
GREY = (158, 158, 158)

radius = rnd.randint(1,8)

display = pygame.display.set_mode(SIZE)
pygame.draw.circle( display, WHITE, SIZEM, radius )

FPS = 60
clock = pygame.time.Clock()
while True:
    for event in pygame.event.get():
        if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE) or event.type == MOUSEBUTTONDOWN:
            sys.exit()

    pygame.display.update()

    clock.tick(FPS)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question