add-tractor #10
9
agent.py
9
agent.py
@ -3,10 +3,11 @@ import settings
|
||||
|
||||
|
||||
class Instance:
|
||||
def __init__(self):
|
||||
def __init__(self, tank_capacity):
|
||||
size = settings.Field.size
|
||||
self.rect = pygame.Rect(0, 0, size(), size())
|
||||
self.action = ''
|
||||
self.tank_capacity = tank_capacity
|
||||
|
||||
def coordinates(self):
|
||||
return {
|
||||
@ -19,7 +20,13 @@ class Instance:
|
||||
|
||||
def y(self):
|
||||
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):
|
||||
key_pressed = pygame.key.get_pressed()
|
||||
height = settings.Pygame.height()
|
||||
|
Loading…
Reference in New Issue
Block a user