15 lines
461 B
Plaintext
15 lines
461 B
Plaintext
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),
|
|
)
|
|
) |