add-tractor #10
9
agent.py
9
agent.py
@ -3,10 +3,11 @@ import settings
|
|||||||
|
|
||||||
|
|
||||||
class Instance:
|
class Instance:
|
||||||
def __init__(self):
|
def __init__(self, tank_capacity):
|
||||||
size = settings.Field.size
|
size = settings.Field.size
|
||||||
self.rect = pygame.Rect(0, 0, size(), size())
|
self.rect = pygame.Rect(0, 0, size(), size())
|
||||||
self.action = ''
|
self.action = ''
|
||||||
|
self.tank_capacity = tank_capacity
|
||||||
|
|
||||||
def coordinates(self):
|
def coordinates(self):
|
||||||
return {
|
return {
|
||||||
@ -20,6 +21,12 @@ class Instance:
|
|||||||
def y(self):
|
def y(self):
|
||||||
return int(self.rect.y / settings.Field.size())
|
return int(self.rect.y / settings.Field.size())
|
||||||
|
|
||||||
|
def get_tank_capacity(self):
|
||||||
|
return self.tank_capacity
|
||||||
|
|
||||||
|
def set_tank_capacity(self, fuel_units):
|
||||||
|
self.tank_capacity = fuel_units
|
||||||
|
|
||||||
def move(self):
|
def move(self):
|
||||||
key_pressed = pygame.key.get_pressed()
|
key_pressed = pygame.key.get_pressed()
|
||||||
height = settings.Pygame.height()
|
height = settings.Pygame.height()
|
||||||
|
Loading…
Reference in New Issue
Block a user