Add Smachni_code1

main
Nils Kosenčuks 2024-01-22 09:21:19 +00:00
parent 79498702b8
commit e18a6a06bb
1 changed files with 15 additions and 0 deletions

15
Smachni_code1 100644
View File

@ -0,0 +1,15 @@
from settings import SCREEN_HEIGHT, SCREEN_WIDTH
import random
import pygame
class Enemy(pygame.sprite.Sprite):
def __init__(self):
super(Enemy, self).__init__()
self.surf = pygame.Surface((20, 10))
self.surf.fill((255, 0, 0))
self.rect = self.surf.get_rect(
center=(
random.randint(SCREEN_WIDTH + 20, SCREEN_WIDTH + 100),
random.randint(0, SCREEN_HEIGHT),
)
)