-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlantsAll.py
56 lines (39 loc) · 1.17 KB
/
PlantsAll.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from tkinter import PhotoImage
from Plant import Plant
from random import randint
class Grass(Plant):
def __init__(self, x, y):
self.name = 'Grass'
self.x = x
self.y = y
self.strength = 0
self.initiative = 0
self.icon = PhotoImage(file='icons/trawa.png')
class SowThistle(Plant):
def __init__(self, x, y):
self.name = 'SowThistle'
self.x = x
self.y = y
self.strength = 0
self.initiative = 0
self.icon = PhotoImage(file='icons/mlecz.png')
def action(self, world):
"""SowThistle has 3 attempts to spread around"""
attempt = 3
self.try_to_spread(world, attempt)
class Guarana(Plant):
def __init__(self, x, y):
self.name = 'Guarana'
self.x = x
self.y = y
self.strength = 0
self.initiative = 0
self.icon = PhotoImage(file='icons/guarana.png')
class DeadlyNightshade(Plant):
def __init__(self, x, y):
self.name = 'DeadlyNightshade'
self.x = x
self.y = y
self.strength = 99
self.initiative = 0
self.icon = PhotoImage(file='icons/wilczajagoda.png')