-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
51 lines (40 loc) · 1.2 KB
/
test.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
from graphics import *
from settings import *
import time
import threading
class a():
def __init__(self):
self.screen = GraphWin(f'{GAMENAME}', WIDTH, HEIGHT, autoflush=False)
self.circle = Circle(Point(200, 300), 30)
self.circle.draw(self.screen)
def i(self):
listaIdleLeft = []
for i in range(1, 10):
img = Image(Point(WIDTH//2, HEIGHT//2),
f'src/sprites/Zombies/Wild Zombie/Idle/Idle_left_{i}.png')
listaIdleLeft.append(img)
for img in listaIdleLeft:
img.draw(self.screen)
update()
# time.sleep(0.07)
img.undraw()
self.screen.after(5000, self.i)
def move(self, key):
if key == 'a':
self.circle.setFill('red')
if key == 'd':
self.circle.setFill('blue')
if key == 'w':
self.circle.setFill('black')
if key == 's':
self.circle.setFill('yellow')
def count(self):
for _ in range(10):
self.circle.move(5, 0)
def update(self, key):
self.i()
self.move(key)
assi = a()
while True:
key = assi.screen.checkKey()
assi.update(key)