Displaying landfields + generating thrashes

This commit is contained in:
michalStarski 2019-03-19 19:11:25 +01:00
parent e2cb089ca9
commit 27fc313acb
6 changed files with 11 additions and 1 deletions

View File

@ -47,6 +47,13 @@ while( home_len > 0 ):
cells[x][y] = House(x,y, 10, 10, 10)
home_len = home_len - 1
for trash_type in range(3):
x = random.randint(0, (PLAY_WIDTH//64)-1)
y = random.randint(0, (PLAY_WIDTH//64)-1)
if( type(cells[x][y]) == Grass ):
cells[x][y] = Landfill(x, y, trash_type)
#Dodawanie wszystkich spritow do grupy spritow
for x in range(len(cells)):
for y in range(len(cells[x])):

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -2,5 +2,5 @@
+Dodanie metody od zapełniania śmietników która updatuje się co klatkę (Jeżeli zapełnienie == 100 to zmienia się sprite i trzeba zabrać czy coś takiego)
-Dodanie hudu
+Wpisywanie na początku gry liczby domków
-Umieszczenie na mapie wysypisk(I dodanie ich klasy)
+Umieszczenie na mapie wysypisk(I dodanie ich klasy)
-W JAKI SPOSÓB MOŻNA PREZENTOWAĆ KILKA RÓŻNYCH ŚMIECI NA DOMKU?

View File

@ -6,6 +6,9 @@ def set_home_amount():
optlist, args = getopt.getopt(arguments, '', ['home-count='])
for o, amount in optlist:
if o == '--home-count':
if int(amount) < 2:
print('Home count too low - must be higher than 2')
sys.exit(2)
return int(amount)
print('Missing argument: --home-count <amount>')
sys.exit(2)