Initial Commit
This commit is contained in:
39
TESTING/refreshed spawned classes.py
Normal file
39
TESTING/refreshed spawned classes.py
Normal file
@@ -0,0 +1,39 @@
|
||||
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()))
|
||||
Reference in New Issue
Block a user