-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscoreboard.cpp
95 lines (86 loc) · 1.65 KB
/
scoreboard.cpp
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
95
#include "scoreboard.h"
#include"widget.h"
ScoreBoard::ScoreBoard():board(sys->score_board)
{
auto p=sys->GetMainWidget();
layer=LAYER_TOP-1;
over=sys->nullimg;
x_over=p->width()/2;
y_over=p->height()/2-185;
x_board=x_over;
x_play=x_board;
y_play=p->height()-230;
y_board=p->height()+35;
p->AddToSubThread(layer,this);
play=sys->nullimg;
}
ScoreBoard::~ScoreBoard()
{
}
void ScoreBoard::frame()
{
auto User=sys->GetMainWidget();
if(timer==29)
{
emit User->SoundSig(MYSOUND::PANEL);
}
else if(timer>=30&&timer<40)
{
y_over=User->height()/2-150+(timer-35)*(timer-35)*0.5;
}
else if(timer==60)
{
emit User->SoundSig(MYSOUND::PANEL);
}
else if(timer>60&&timer<=102)
{
y_board-=10;
}
else if(timer==130)
{
//
}
else if(timer>170)
task=false;
if(timer>110&&timer2<30)
{
timer2++;
}
timer++;
}
void ScoreBoard::show(QPainter & p)
{
auto User=sys->GetMainWidget();
if(timer>30)
{
if(timer<40)
{
over=User->tools->SetAlgha(sys->game_over,15+24*(timer-30));
}
DrawPixmapAtCenter(x_over,y_over,over,p);
}
if(timer>60)
{
DrawPixmapAtCenter(x_board,y_board,board,p);
}
if(timer>130)
{
if(timer<170)
{
play=User->tools->SetAlgha(sys->button_play,15+6*(timer-130));
}
DrawPixmapAtCenter(x_play,y_play,play,p);
}
if(timer>110)
{
User->socre->ShowResult(p);
}
}
void ScoreBoard::gameover()
{
return;
}
void ScoreBoard::restart()
{
del_flag=true;
}