aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-01-07 18:16:46 +0100
committersalaaad2 <arthurdurant263@gmail.com>2022-01-07 18:16:46 +0100
commitf7337d1c1bf363111a8795c85c684d96f0495f1a (patch)
treec62a965c2de60c6fed7d8229599862dbf8c735b5
parentamazing interface man. good JOB (diff)
downloadthreshold-f7337d1c1bf363111a8795c85c684d96f0495f1a.tar.gz
threshold-f7337d1c1bf363111a8795c85c684d96f0495f1a.tar.bz2
threshold-f7337d1c1bf363111a8795c85c684d96f0495f1a.tar.xz
threshold-f7337d1c1bf363111a8795c85c684d96f0495f1a.tar.zst
threshold-f7337d1c1bf363111a8795c85c684d96f0495f1a.zip
infiniload for some reason
-rw-r--r--src/main.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index da25933..aeff74e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -32,8 +32,8 @@ int main(void) {
if (entry.path().filename().generic_string().find("start") != std::string::npos)
{
pick[i] = entry.path().filename().generic_string();
+ i++;
}
- i++;
}
// Main game loop
while (!WindowShouldClose()) /* Detect window close button or ESC key */
@@ -51,13 +51,20 @@ int main(void) {
{
if (IsKeyPressed(KEY_ENTER))
{
+ std::string s(path);
+ s += pick[nPick];
+ game = new Game(s);
gs = GAMEPLAY;
game->start();
}
- if (IsKeyPressed(KEY_DOWN))
+ if (IsKeyPressed(KEY_DOWN) && nPick < (pick.size() - 1))
{
nPick++;
}
+ if (IsKeyPressed(KEY_UP) && nPick > 0)
+ {
+ nPick--;
+ }
}
case (GAMEPLAY):
{
@@ -101,8 +108,8 @@ int main(void) {
{
DrawRectangle(200, 100, 1200, 700, RAYWHITE);
DrawRectangle(250, 150, 1100, 600, COOLPURPLE);
- DrawRectangle(300, 200, 1000, 500, RAYWHITE);
DrawText("THRESHOLD", 260, 160, 30, RAYWHITE);
+ DrawRectangle(300, 200, 1000, 500, RAYWHITE);
DrawText("PRESS ENTER", (SCREENWIDTH / 2) - 140, (SCREENHEIGHT / 2) + 50, 40, MAROON);
break ;
}
@@ -113,10 +120,11 @@ int main(void) {
DrawRectangle(300, 200, 1000, 500, RAYWHITE);
DrawText("THRESHOLD", 260, 160, 30, RAYWHITE);
+ DrawRectangle(350, 240 + (nPick * 40), 900, 50, PURPLE);
for (auto n = 0 ; n < pick.size(); n++)
{
- DrawText(pick[n].c_str(), SCREENWIDTH / 2,
- (SCREENHEIGHT / 2) + n * 40, 40, COOLPURPLE);
+ DrawText(pick[n].c_str(), 400,
+ 240 + (n * 40), 40, COOLPURPLE);
}
break ;