9
9
#include < string>
10
10
#include < cstdlib>
11
11
#include < ctime>
12
- #include < sstream >
12
+ #include < iostream >
13
13
14
14
// Screen dimension constants
15
15
const int SCREEN_WIDTH = 640 ;
@@ -111,8 +111,8 @@ void Score::render(int number)
111
111
class ScoreBoard
112
112
{
113
113
public:
114
- int WIDTH = 4 ;
115
- int HEIGHT = 17 ;
114
+ int WIDTH = 160 ;
115
+ int HEIGHT = 480 ;
116
116
117
117
// Initializes the variables
118
118
ScoreBoard ();
@@ -131,7 +131,9 @@ class ScoreBoard
131
131
132
132
ScoreBoard::ScoreBoard ()
133
133
{
134
- LoadBitmap (sprite," scoreboard.bmp" );
134
+ LoadBitmap (sprite," Scoreboard.bmp" );
135
+ x=480 ;
136
+ y=480 ;
135
137
}
136
138
137
139
ScoreBoard::~ScoreBoard ()
@@ -141,7 +143,7 @@ ScoreBoard::~ScoreBoard()
141
143
142
144
void ScoreBoard::render ()
143
145
{
144
- sprite.render (480 , 480 );
146
+ sprite.render (x,y );
145
147
}
146
148
147
149
class Enemy
@@ -700,6 +702,7 @@ int main( int argc, char* args[] )
700
702
Enemy enemies [100 ];
701
703
bullet EnemyBullet [20 ];
702
704
Score points[5 ];
705
+ ScoreBoard board;
703
706
704
707
705
708
for (int x = 0 ; x < 3 ; x++)
@@ -858,14 +861,12 @@ int main( int argc, char* args[] )
858
861
859
862
gameOver ();
860
863
861
- for (int f = 2 ; f<4 ; f++)
864
+ for (int f = 0 ; f<3 ; f++)
862
865
{
863
866
points[f].setxy (SCREEN_WIDTH*3 /4 -60 -f*50 ,SCREEN_HEIGHT*3 /4 +50 );
864
867
points[f].render (score[f]);
865
868
}
866
869
867
-
868
-
869
870
quit = true ;
870
871
break ;
871
872
}
@@ -919,18 +920,20 @@ int main( int argc, char* args[] )
919
920
}
920
921
}
921
922
923
+ board.render ();
924
+
922
925
for (int f = 0 ; f<3 ; f++)
923
926
{
924
- if (f == 3 )
925
- {
926
- points[f].setxy (SCREEN_WIDTH*3 /4 +50 ,SCREEN_HEIGHT);
927
- points[f].render (level);
928
- }
929
- else
930
- {
927
+ // if (f == 3)
928
+ // {
929
+ // points[f].setxy(SCREEN_WIDTH*3/4+50,SCREEN_HEIGHT);
930
+ // points[f].render(level);
931
+ // }
932
+ // else
933
+ // {
931
934
points[f].setxy (SCREEN_WIDTH-60 -f*50 ,50 );
932
935
points[f].render (score[f]);
933
- }
936
+ // }
934
937
}
935
938
936
939
// Update screen
0 commit comments