code cleaning
This commit is contained in:
parent
f860b1ce45
commit
bdddb68e90
@ -7,7 +7,7 @@ from field import Field
|
|||||||
def generate_field () -> List[List[Field]]:
|
def generate_field () -> List[List[Field]]:
|
||||||
fieldsFactory = FieldsFactory()
|
fieldsFactory = FieldsFactory()
|
||||||
fieldsList = fieldsFactory.getFieldsList()
|
fieldsList = fieldsFactory.getFieldsList()
|
||||||
return [choices (fieldsList, weights=[10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range (10)]
|
return [choices(fieldsList, weights=[10, 10, 4, 4, 4, 4, 4, 4, 4, 4, 4], k=10) for _ in range(10)]
|
||||||
|
|
||||||
|
|
||||||
class Environment:
|
class Environment:
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from field import Field
|
from field import Field
|
||||||
|
|
||||||
|
|
||||||
class FieldsFactory:
|
class FieldsFactory:
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def createField(self, number) -> Field:
|
def createField(self, number) -> Field:
|
||||||
if number > 3:
|
if number > 3:
|
||||||
return Field(number, True)
|
return Field(number, True)
|
||||||
|
@ -29,7 +29,6 @@ class GameUi:
|
|||||||
def update(self):
|
def update(self):
|
||||||
for x in range(10):
|
for x in range(10):
|
||||||
for y in range(10):
|
for y in range(10):
|
||||||
print(IMAGES[self.env.field[y][x].number])
|
|
||||||
self.screen.blit(IMAGES[self.env.field[y][x].number], (x * 80, y * 80))
|
self.screen.blit(IMAGES[self.env.field[y][x].number], (x * 80, y * 80))
|
||||||
self.screen.blit(self.agent.img, (self.agent.x * 80, self.agent.y * 80))
|
self.screen.blit(self.agent.img, (self.agent.x * 80, self.agent.y * 80))
|
||||||
pg.display.update()
|
pg.display.update()
|
||||||
|
Loading…
Reference in New Issue
Block a user