35 lines
780 B
Python
35 lines
780 B
Python
|
import random
|
||
|
|
||
|
class Tile:
|
||
|
x = 0
|
||
|
y = 0
|
||
|
plant = None
|
||
|
ground = None
|
||
|
|
||
|
photo = None
|
||
|
image = None
|
||
|
|
||
|
# after checking a photo add information plant object ("potato"/ "wheat"/"none")
|
||
|
|
||
|
# add Ground instance
|
||
|
|
||
|
def __init__(self, x, y):
|
||
|
self.x = x
|
||
|
self.y = y
|
||
|
|
||
|
# add to init ground instance
|
||
|
|
||
|
# called on a created tile
|
||
|
|
||
|
def randomizeContent(self):
|
||
|
i = random.randint(1, 3) #szansa 1/3
|
||
|
if i == 1:
|
||
|
self.image = "resources/images/sampling.png"
|
||
|
#self.picture losuje dodatkowo zdjecie jakies rosliny do danego rzędu
|
||
|
else:
|
||
|
self.image = "resources/images/dirt.png"
|
||
|
|
||
|
|
||
|
# DISCLAMER check column and choose plant type ("potato","wheat" etc)
|
||
|
|