-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
55 lines (46 loc) · 1.23 KB
/
main.py
File metadata and controls
55 lines (46 loc) · 1.23 KB
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
from colorama import Fore, Back, Style
import sys, time
import canvas
import random
import state
import input
if __name__=='__main__':
cnvs = state.cnvs
slider = state.slider
ball = state.ball
bc = state.bc
pus = state.pus
while not state.quit:
if cnvs.pause==False and not cnvs.gameover:
slider.clear()
ball.clear()
pus.clear()
if state.dp_ball!=None:
state.dp_ball.clear()
ball.update()
pus.update()
input.onKeyPress()
if state.dp_ball!=None:
state.dp_ball.update()
print('\033c')
bc.render()
pus.render()
ball.render()
if state.dp_ball!=None:
state.dp_ball.render()
slider.render()
else:
print('\033c')
input.onKeyPress()
cnvs.render()
if cnvs.gameover==True:
slider.clear()
ball.clear()
pus.clear()
cnvs = state.cnvs
slider = state.slider
ball = state.ball
bc = state.bc
pus = state.pus
time.sleep(0.03)
print('\033c')