Traktor/tractor.py
2024-03-10 02:46:14 +01:00

16 lines
540 B
Python

import pygame
from constant import size
class Tractor:
def __init__(self, row, col):
self.row = row
self.col = col
self.images = {
"up": pygame.image.load("up.png"),
"down": pygame.image.load("down.png"),
"left":pygame.image.load("left.png"),
"right":pygame.image.load("right.png")
}
self.direction = "down"
def draw(self, win):
tractor_image = self.images[self.direction]
win.blit(tractor_image, (self.col*size, self.row*size))