forked from Red-0111/Anything-Repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPacman.py
31 lines (25 loc) · 848 Bytes
/
Pacman.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
The Code Given Below Is For The Python File Enemies
import pygame
import random
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 576
# Define some colors
BLACK = (0,0,0)
WHITE = (255,255,255)
BLUE = (0,0,255)
GREEN = (0,255,0)
RED = (255,0,0)
class Block(pygame.sprite.Sprite):
def __init__(self,x,y,color,width,height):
# Call the parent class (Sprite) constructor
pygame.sprite.Sprite.__init__(self)
# Set the background color and set it to be transparent
self.image = pygame.Surface([width,height])
self.image.fill(color)
self.rect = self.image.get_rect()
self.rect.topleft = (x,y)
class Ellipse(pygame.sprite.Sprite):
def __init__(self,x,y,color,width,height):
# Call the parent class (Sprite) constructor
pygame.sprite.Sprite.__init__(self)
# Set the background