38 for(
string& value : currentMenu.
entries ){
57 for(
string& value : currentMenu.
entries ){
64 for (
auto& value: rankings){
73 vector<string> entries {
"single player",
"multi player (local)",
"exit"};
77 chrono::milliseconds waitTime = chrono::milliseconds(100);
82 ++initial.currentValue;
83 if (initial.currentValue > initial.entries.size()-1) initial.currentValue = 0;
84 this_thread::sleep_for(waitTime);
88 if (initial.currentValue == 0) initial.currentValue = initial.entries.size()-1;
89 else --initial.currentValue;
90 this_thread::sleep_for(waitTime);
93 switch(initial.currentValue){
109 name = string(6,
'A');
110 unsigned currentSelected = 0 ;
111 chrono::milliseconds waitTime = chrono::milliseconds(100);
117 for (
unsigned i = 0; i < name.size(); ++i){
124 ++name[currentSelected];
125 if (name[currentSelected] > 90) name[currentSelected] = 65;
126 this_thread::sleep_for(waitTime);
130 --name[currentSelected];
131 if (name[currentSelected] < 65) name[currentSelected] = 90;
132 this_thread::sleep_for(waitTime);
137 if (currentSelected > name.size()-1) currentSelected = 0;
138 this_thread::sleep_for(waitTime);
142 if (currentSelected == 0) currentSelected = name.size()-1;
143 else --currentSelected;
144 this_thread::sleep_for(waitTime);
157 vector<string> entries {
"retry",
"main menu"};
161 chrono::milliseconds waitTime = chrono::milliseconds(100);
166 ++death.currentValue;
167 if (death.currentValue > death.entries.size()-1) death.currentValue = 0;
168 this_thread::sleep_for(waitTime);
172 if (death.currentValue == 0) death.currentValue = death.entries.size()-1;
173 else --death.currentValue;
174 this_thread::sleep_for(waitTime);
177 switch(death.currentValue){
bool isOpen() const
Retourne si la fenêtre est ouverte.
bool isPressed(const KeyType_t &key)
Renvoie l'état d'une touche du clavier (pressée ou non)
void resetKey(const KeyType_t &key)
Force une touche a être relâchée.
void startFrame() const
clear the screen for a new frame
void drawSprite(const MySprite &msp, const Position &pos) const
display a sprite on screen
MySprite menuBackground
sprite of the background during menu
PlayMode showInitialMenu()
show the title screen of the game
void displayButton(const Position &baseVector, const string &text, nsGraphics::RGBAcolor &color)
display a menu button on screen
void endFrame() const
finish a frame render
void drawText(const Position &pos, const string &text, const RGBAcolor &color=nsGraphics::KWhite, Font font=Font::BITMAP_TIMES_ROMAN_24) const
display text on screen
unsigned getScreenHeight() const
give the height of the screen
unsigned getScreenWidth() const
give the width of the screen
MySprite logo
sprite of the logo of the game
void displayMenu(const Position &pos, Menu ¤tMenu)
display a menu on screen
bool showDeathMenu(const vector< ScoreLink > &rankings, const WinValue &winner)
show the menu after a player lose, or all invader has been defeated
void askPlayerNameMenu(playerID pID, unsigned score, string &name)
Classe représentant un couleur RGBA8888.
Classe représentant un vecteur deux-dimensionnel.
Gère l'affichage d'un texte.
Classe représentant un rectangle.
Espace de nom pour les utilitaires graphiques.
Espace de nom pour différentes formes.
PlayMode
List of all game playmode.
nsGraphics::Vec2D Position
WinValue
list of win values