This repository has been archived on 2025-07-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
shroom_of_doom/TESTING/refreshed spawned classes.py
2025-02-26 14:40:25 -05:00

40 lines
911 B
Python

import pygame
from os import path
class Guy():
def __init__(self, mouseCoords):
self.coords = mouseCoords
self.image = pygame.image.load(path.dirname(__file__) + "/../data/image/ui/icons/settings_neutral.png")
def draw(self):
"""
Draws character.
"""
WINDOW.blit(self.image, (self.coords))
WINDOW = pygame.display.set_mode((720, 480))
CLOCK = pygame.time.Clock()
gameOn = True
guys = []
while gameOn:
CLOCK.tick(30)
WINDOW.fill((150, 150, 150))
for guy in guys:
guy.draw()
pygame.display.flip()
for event in pygame.event.get():
if event.type == pygame.QUIT:
gameOn = False
pygame.quit()
elif event.type == pygame.MOUSEBUTTONDOWN:
if 0 in pygame.mouse.get_pressed():
# Left button pressed
guys.append(Guy(pygame.mouse.get_pos()))