-
Notifications
You must be signed in to change notification settings - Fork 0
/
weapon.py
61 lines (42 loc) · 1 KB
/
weapon.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
57
58
59
60
61
import turtle
class weapon(Turtle):
def __init__(self,canvas,x,y,dz,dy,shape,damage,mana_cost,mana_use):
RawTurtle.__init__(self,canvas)
self.penup()
self.status_bool = False
self.goto(x,y)
` self.damage=damage
self.mana_cost=mana_cost
self.dx = dx
self.dy = dy
self.mana_use = mana_use
self.shape("weapon")
def enemyisinrange(self,enemy):
x= self.xcor()
y=self.ycor()
if(self.ycor()=enemy.ycor() and (enemy.xcor()-self.xcor():
return True
def get_mana_use(self):
return self.mana_use
def show(self):
self.showturtle()
self.status_bool = True
def status(self):
return self.status_bool
def hide(self):
self.hideturtle()
self.status_bool=False
def shoot(self):
if mana_status==True
for x in range(0,800,1):
x= self.xcor()
y=self.ycor()
self.goto (x,y)
else:
print("not enof mama")
def return_weapon (self,player):
if enemyisinrange== True:
hide()
self.goto(player.xcor(),player.ycor())
#make sure
turtle.mainloop()