This is my first solo project using Python. This PyGame has two modes, single player and multi player. This monster catching game has five levels, the higher the level, the more monsters. Score is shown of the top left corner and level on the top right corner.
Python
- Fork this respository
Click the Fork button on the upper right-hand side of this repository's page. - Clone the repository
Under the repository name, click on the code button and copy the clone URL for the repository. - Run the file
python -m pip install pygame
Open the file on Visual Studio Code and run
class Block(pygame.sprite.Sprite):
def __init__(self, image, pos):
pygame.sprite.Sprite.__init__(self)
self.image = image
self.rect = self.image.get_rect()
self.rect.center = pos
def update(self, height, width): # boundary for monsters
if self.rect.x > width or self.rect.x < 0 or self.rect.y > height or self.rect.y < 0:
self.rect.x = random.randint(0, 490)
self.rect.y = random.randint(0, 490)
This project is under MIT license. See the license for more information.