add-tractor #10

Merged
s459307 merged 3 commits from add-tractor into master 2022-03-25 04:26:07 +01:00
5 changed files with 11 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__/

View File

@ -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()

BIN
assets/tracktor/tractor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -6,7 +6,7 @@ import settings
import common
import agent
AGENT_IMG = pygame.image.load("dot-22-433567.png")
AGENT_IMG = pygame.image.load('./assets/tracktor/tractor.png')
AGENT = pygame.transform.scale(AGENT_IMG, (settings.Field.size(), settings.Field.size()))
possibleFields = {
@ -65,7 +65,7 @@ def draw_window(agent, fields):
common = common.Instance()
agent = agent.Instance()
agent = agent.Instance(1000)
def main():