SprytnyTraktor/tractor.py

21 lines
568 B
Python
Raw Normal View History

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):
self.y = self.y + definitions.BLOCK_SIZE
2021-03-21 12:40:13 +01:00
def move_left(self):
self.x = self.x - definitions.BLOCK_SIZE
2021-03-21 12:40:13 +01:00
def move_right(self):
self.x = self.x + definitions.BLOCK_SIZE
2021-03-21 12:40:13 +01:00
def move_up(self):
self.y = self.y - definitions.BLOCK_SIZE