2021-03-21 12:40:13 +01:00
|
|
|
import definitions
|
|
|
|
class Tractor:
|
|
|
|
def __init__(self, x, y):
|
2021-03-21 13:45:20 +01:00
|
|
|
self.x = x
|
|
|
|
self.y = y
|
2021-03-21 12:40:13 +01:00
|
|
|
def get_x(self):
|
|
|
|
return self.x
|
|
|
|
def set_x(self, x):
|
|
|
|
self.x = x
|
|
|
|
def get_y(self):
|
|
|
|
return self.y
|
|
|
|
def set_y(self, y):
|
|
|
|
self.y = y
|
|
|
|
def move_down(self):
|
2021-03-23 17:14:46 +01:00
|
|
|
self.y = self.y + definitions.BLOCK_SIZE
|
2021-03-21 12:40:13 +01:00
|
|
|
def move_left(self):
|
2021-03-23 17:14:46 +01:00
|
|
|
self.x = self.x - definitions.BLOCK_SIZE
|
2021-03-21 12:40:13 +01:00
|
|
|
def move_right(self):
|
2021-03-23 17:14:46 +01:00
|
|
|
self.x = self.x + definitions.BLOCK_SIZE
|
2021-03-21 12:40:13 +01:00
|
|
|
def move_up(self):
|
2021-03-23 17:14:46 +01:00
|
|
|
self.y = self.y - definitions.BLOCK_SIZE
|