-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
66 lines (51 loc) · 1.12 KB
/
main.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
62
63
64
65
66
import pgzrun
from pgzhelper import *
from sprite import Sprite
from button import Button
WIDTH = 800
HEIGHT = 600
step = 0
sprites = []
buttons = []
background = Actor("baseball")
#Add your code below
abby = Sprite("abby-a")
abby.scale = 0.5
sprites.append(abby)
devin = Sprite("devin-a")
devin.scale = 0.5
sprites.append(devin)
def next():
global step
step += 1
step_changed()
next_button = Button("next", (700, 400), next)
buttons.append(next_button)
def step_changed():
print(step)
if step == 0:
abby.show = False
devin.show = False
elif step == 1:
abby.show = True
devin.show = True
abby.message="Hi, how are you?"
def draw():
screen.clear()
background.draw()
for s in sprites:
s.draw()
for b in buttons:
b.draw()
# elements need to be draw here
def update():
# any global variable need to be updated need specify global
pass
def on_mouse_down(pos):
for b in buttons:
b.on_mouse_down(pos)
def on_mouse_up(pos):
for b in buttons:
b.on_mouse_up(pos)
step_changed()
pgzrun.go() # Must be last line