Retro_Gameboy
The purpose of this project is to create a GameBoy with classic games.
GameGenerics.cpp
Go to the documentation of this file.
1 #include <unistd.h>
2 #include "../include/GameGenerics.h"
3 
5 {
6 
7 }
8 
9 void GameGenerics::GameOverScreen( RenderWindow& window )
10 {
11  Texture texture;
12  texture.loadFromFile( "images/Arkanoid_Img/gameover.png" );
13  Sprite s_GameOver( texture );
14  s_GameOver.setPosition( 50, 50 );
15 
16  window.clear();
17  window.draw( s_GameOver );
18 
19  std::string strScore = std::to_string( CalculateScore() );
20  std::string textstring = "Score: " + strScore;
21 
22  Font font;
23  font.loadFromFile( "fonts/arial.ttf" );
24  Text text( textstring.c_str(), font, 30 );
25  text.setPosition( 100, 250 );
26  text.setColor( sf::Color::Red );
27  window.draw( text );
28 
29  window.display();
30  sleep(3);
31  window.close();
32 
33 }
GameGenerics()
Default Constructor for GameGenerics. This is a abstract class and you cannot instantiate this class.
Definition: GameGenerics.cpp:4
void GameOverScreen(RenderWindow &window)
Display a game over screen at the end of the game alone with user's score. Currently,...
Definition: GameGenerics.cpp:9
virtual int CalculateScore()=0
Pure virtual function inherited from GameGenerics.h Each game calculate scores differently and theref...