Traktor/source/ground.py

27 lines
743 B
Python
Raw Permalink Normal View History

import random
2024-03-07 18:01:12 +01:00
class Dirt:
def __init__(self, water_level, nutrients_level):
self.water_level = water_level
self.nutrients_level = nutrients_level
self.pest = False
self.weed = False
self.obstacle = False
self.pests_and_weeds()
2024-03-07 18:01:12 +01:00
# add a couple new properties
def pests_and_weeds(self):
i = random.randint(1, 20) # 5% szans na szkodniki, 10% na chwasty, 5 na obydwa 15 na kamien
if i == 1:
self.pest = True
elif i == 2 or i == 3:
self.weed = True
elif i == 4:
self.weed = True
self.pest = True
elif i == 5:
self.obstacle = True
2024-03-07 18:01:12 +01:00
# add init, getters,setters