-
Notifications
You must be signed in to change notification settings - Fork 0
/
Splash.py
94 lines (71 loc) · 1.8 KB
/
Splash.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
from tex_load import *
from Gui import *
from Class import *
import winsound
from Variables import *
def rect1():
glColor(Color('00b9ff'))
glColor(Color('ffffff'))
glBegin(GL_QUADS)
glTexCoord2f(0, 0)
glVertex3f(0, 0, 0)
glTexCoord2f(0, 1)
glVertex3f(0, 70, 0)
glTexCoord2f(1, 1)
glVertex3f(300, 70, 0)
glTexCoord2f(1, 0)
glVertex3f(300, 0, 0)
glEnd()
glDisable(GL_TEXTURE_2D)
def mouse_motion(x, y):
global mouse_x, mouse_y
mouse_x = x
mouse_y = WINDOW_HEIGHT - y
def Logo_display():
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
background_tex.draw_tex()
background.build_center()
glLoadIdentity()
pocket_tanks_intro_tex.draw_tex()
pocket_tanks.build_center()
alpha = 0
xt = 0
R = 1
L = 0
def splash_display():
global xt, yt, R, L, c, r_angle, newmouse_x, newmouse_y, alpha
glClear(GL_COLOR_BUFFER_BIT)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
init_tex(splash_background_tex, background, alpha)
if alpha <= 1:
alpha += 0.002
glLoadIdentity()
if (play.left <= mouse_x <= play.right and play.bottom <= mouse_y <= play.top):
init_tex(play_button_b, play, alpha)
else:
init_tex(play_button_r, play, alpha)
glDisable(GL_TEXTURE_2D)
glLoadIdentity()
init_tex(splash_logo_tex, splash_logo, alpha)
glLoadIdentity()
if R:
init_tex(splash_tank_r_tex, splash_tank, alpha, xt)
if L:
init_tex(splash_tank_l_tex, splash_tank, alpha, xt)
glLoadIdentity()
glColor(0, 1, 0)
glutSolidSphere(50, 30, 30)
glutSwapBuffers()
c = -c
r_angle += 0.8
if xt > 1000 - 150 or L:
R = 0
L = 1
xt -= 0.8
if xt < 100 or R:
R = 1
L = 0
xt += 0.8