-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from 8enrich/NewButtons
Melhorias sonoras e outras mudanças
- Loading branch information
Showing
22 changed files
with
106 additions
and
24 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
10, | ||
20 | ||
], | ||
"CELLSIZE": 22, | ||
"CELLSIZE": 23, | ||
"CONTROL": 0, | ||
"CUSTOM_CONTROLS": [ | ||
87, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ enum Screens { | |
MENU, | ||
PAUSE, | ||
GAMEOVER, | ||
STATS, | ||
NOTSCREEN, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <raylib.h> | ||
#include "Screen.hpp" | ||
#include "ScreenButton.hpp" | ||
#include "ButtonManager.hpp" | ||
|
||
class Stats : public Screen { | ||
public: | ||
Stats(); | ||
~Stats(); | ||
void Tick() override; | ||
void OpenClose() override; | ||
private: | ||
void OptionsHandling(); | ||
void Draw() override; | ||
const float fontSize = 1.0f/30; | ||
const std::vector<Button*> buttons = { &returnButton }; | ||
ScreenButton returnButton; | ||
ButtonManager *buttonManager; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "../include/Stats.hpp" | ||
#include "raylib.h" | ||
|
||
Stats::Stats(): | ||
returnButton(ScreenButton("<", Vec2<double>{1.0f/30, 1.0f/50}, 1.0f/20, MENU)), | ||
buttonManager(new ButtonManager(buttons)) | ||
{} | ||
|
||
Stats::~Stats(){ | ||
for(Button *button : buttons) delete button; | ||
delete buttonManager; | ||
} | ||
|
||
void Stats::Tick(){ | ||
OptionsHandling(); | ||
BeginDrawing(); | ||
Draw(); | ||
buttonManager->Tick(); | ||
EndDrawing(); | ||
} | ||
|
||
void Stats::Draw(){ | ||
ClearBackground(BLACK); | ||
ray_functions::DrawFormatedText("HIGHSCORES", Vec2<double>{1.0f/2, 1.0f/5}, 1.0f/13, RAYWHITE); | ||
for(int i = 0; i < 5; i++){ | ||
ray_functions::DrawFormatedText(TextFormat("%d", settings::highscores[i]), Vec2<double>{1.0f/2, (1 + 0.17 *(i + 1))/3.2}, | ||
1.0f/20, RAYWHITE); | ||
} | ||
} | ||
|
||
void Stats::OptionsHandling(){ | ||
Screens screen = buttonManager->GetScreen(); | ||
if(screen != NOTSCREEN){ | ||
buttonManager->ResetScreen(); | ||
nextScreen = screen; | ||
OpenClose(); | ||
} | ||
if(GetKeyPressed() == KEY_ESCAPE) OpenClose(); | ||
} | ||
|
||
void Stats::OpenClose(){ | ||
Screen::OpenClose(); | ||
if(!shouldClose){ | ||
returnButton.SetScreen(nextScreen); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters