Skip to content

Commit 54be43c

Browse files
committed
Scoreboard is broken
1 parent b12cdc9 commit 54be43c

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

Scoreboard.bmp

-960 Bytes
Binary file not shown.

main.cpp

+19-16
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <string>
1010
#include <cstdlib>
1111
#include <ctime>
12-
#include <sstream>
12+
#include <iostream>
1313

1414
//Screen dimension constants
1515
const int SCREEN_WIDTH = 640;
@@ -111,8 +111,8 @@ void Score::render(int number)
111111
class ScoreBoard
112112
{
113113
public:
114-
int WIDTH = 4;
115-
int HEIGHT = 17;
114+
int WIDTH = 160;
115+
int HEIGHT = 480;
116116

117117
//Initializes the variables
118118
ScoreBoard();
@@ -131,7 +131,9 @@ class ScoreBoard
131131

132132
ScoreBoard::ScoreBoard()
133133
{
134-
LoadBitmap(sprite,"scoreboard.bmp");
134+
LoadBitmap(sprite,"Scoreboard.bmp");
135+
x=480;
136+
y=480;
135137
}
136138

137139
ScoreBoard::~ScoreBoard()
@@ -141,7 +143,7 @@ ScoreBoard::~ScoreBoard()
141143

142144
void ScoreBoard::render()
143145
{
144-
sprite.render(480,480);
146+
sprite.render(x,y);
145147
}
146148

147149
class Enemy
@@ -700,6 +702,7 @@ int main( int argc, char* args[] )
700702
Enemy enemies [100];
701703
bullet EnemyBullet [20];
702704
Score points[5];
705+
ScoreBoard board;
703706

704707

705708
for (int x = 0; x < 3; x++)
@@ -858,14 +861,12 @@ int main( int argc, char* args[] )
858861

859862
gameOver();
860863

861-
for (int f = 2; f<4; f++)
864+
for (int f = 0; f<3; f++)
862865
{
863866
points[f].setxy(SCREEN_WIDTH*3/4-60-f*50,SCREEN_HEIGHT*3/4+50);
864867
points[f].render(score[f]);
865868
}
866869

867-
868-
869870
quit = true;
870871
break;
871872
}
@@ -919,18 +920,20 @@ int main( int argc, char* args[] )
919920
}
920921
}
921922

923+
board.render();
924+
922925
for (int f = 0; f<3; f++)
923926
{
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+
// {
931934
points[f].setxy(SCREEN_WIDTH-60-f*50,50);
932935
points[f].render(score[f]);
933-
}
936+
// }
934937
}
935938

936939
//Update screen

0 commit comments

Comments
 (0)