40 lines
911 B
Python
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()))
|