-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItem.py
24 lines (24 loc) · 936 Bytes
/
Item.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
from cmu_graphics import *
from Character import *
from Sword import *
from Shield import *
from Fireball import *
from ClassFunctions import *
class Item:
itemList = []
def __init__(self, cX, cY, level, room, group):
if level == 12:
self.light = Circle(cX, cY, self.shape.width + 10, self.shape.height + 10, fill = gradient('white', 'ghostwhite', 'whitesmoke'), opacity = 20)
group.add(self.light)
objctSet(self, level, room, group)
Item.itemList[level - 1][room].append(self)
def reset(self):
self.shape.visible = self.level == app.level and self.room == app.room
if self.level == 12:
self.light.visible = True
def obtain(self):
if self.shape.hitsShape(character.shape) and self.shape.visible:
if self.level == 12:
self.light.visible = False
self.shape.visible = False
self.effect()