1
0
forked from s434673/AI_Waiter

Small improvements (matrix notation, prep to clear)

This commit is contained in:
s444427 2020-04-03 15:47:08 +02:00
parent 12ecd02a27
commit a206b3709c
3 changed files with 12 additions and 14 deletions

View File

@ -29,8 +29,9 @@ class Waiter(pygame.sprite.Sprite):
# TILE # TILE
class Tile: class Tile:
x_position = 0 def __init__(self):
y_position = 0 self.x_position = 0
self.y_position = 0
# SETUP # SETUP
@ -56,20 +57,19 @@ def drawBackground():
def matrix_creator(): def matrix_creator():
for y in range(15): for x in range(14):
matrix.append([0] * 14) matrix.append([0] * 15)
for y in range(15): for x in range(14):
for x in range(14): for y in range(15):
matrix[y][x] = Tile() matrix[x][y] = Tile()
matrix[y][x].x_position = x matrix[x][y].x_position = x
matrix[y][x].y_position = y matrix[x][y].y_position = y
waiterPly = Waiter() waiterPly = Waiter()
if __name__ == "__main__":
def main():
drawBackground() drawBackground()
matrix_creator() matrix_creator()
@ -94,6 +94,3 @@ def main():
waiterPly.update() waiterPly.update()
pygame.display.flip() pygame.display.flip()
clock.tick(fps) clock.tick(fps)
main()

1
src/tile.py Normal file
View File

@ -0,0 +1 @@

0
src/waiter.py Normal file
View File