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

1
src/tile.py Normal file
View File

@ -0,0 +1 @@

0
src/waiter.py Normal file
View File