forklift image
This commit is contained in:
parent
34dbe4dc57
commit
fc494403a2
23
main.py
23
main.py
@ -3,9 +3,24 @@ import sys
|
||||
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1280, 720))
|
||||
wozek = pygame.Rect(55,55,50,50)
|
||||
c = (0, 150, 0)
|
||||
|
||||
class Wozek:
|
||||
def __init__(self):
|
||||
self.x = 55
|
||||
self.y = 55
|
||||
self.height = 64
|
||||
self.width = 64
|
||||
self.image = pygame.image.load("wozek.png")
|
||||
# Credit: Forklift icons created by Smashicons - Flaticon
|
||||
# https://www.flaticon.com/free-icons/forklift
|
||||
|
||||
def draw(self):
|
||||
screen.blit(self.image, (self.x, self.y))
|
||||
|
||||
|
||||
def main():
|
||||
wozek = Wozek()
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
@ -34,5 +49,9 @@ while True:
|
||||
|
||||
#Drawing
|
||||
screen.fill((0,0,0)) #removes object trail
|
||||
pygame.draw.rect(screen, (0,150,255), wozek) #resolution, color, object
|
||||
pygame.display.flip() #updating frames
|
||||
wozek.draw()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user