thatscringebro e397e49b58 save
2023-10-11 00:01:57 -04:00

69 lines
8.1 KiB
C++

#ifndef GAME_H
#define GAME_H
#include <SFML/Graphics.hpp>
#include <iostream>
#include <iomanip>
#include "racecar.h"
class Game {
public:
Game();
void run();
bool isTrackCollision(float x, float y);
std::string determineQuadrant(float x, float y);
void displaySavedTimes();
private:
int max_x;
int max_y;
int direction;
sf::RenderWindow window;
sf::Font font;
sf::Text speedText;
sf::Text mapText;
sf::Text timerText;
sf::Clock gameTimeClock;
sf::View view;
Racecar racecar;
std::vector<std::pair<std::string, std::string>> timesAndQuadrants; // Store times and quadrants
bool lapStarted; // Indicates if a lap has started
std::vector<std::string> lapTimes; // Store lap times
std::string asciiMap = " /------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\\ \n"
" / \\ \n"
" / | \n"
" / | \n"
" / _____________________________________________________________________________________________________________________________________________________________ | \n"
" / / \\ | \n"
" / / | | \n"
" / | /------------------------------------------------------\\ / | \n"
"/ | / \\ _____ __________________ .___.___ / / \n"
"| || | / _ \\ / _____/\\_ ___ \\| | | / / \n"
"| || | / /_\\ \\ \\_____ \\ / \\ \\/| | | / / \n"
"| || __________________________ | / | \\/ \\\\ \\___| | | / / \n"
"| || / \\ | \\____|__ /_______ / \\______ /___|___| / / \n"
"| || / | | \\/ \\/ \\/ / / \n"
"| || | | | __________ _____ _________ _____________________ / / \n"
"| || | / / \\______ \\ / _ \\ \\_ ___ \\_ _____/\\______ \\ / / \n"
"| || | / / | _/ / /_\\ \\/ \\ \\/ | __)_ | _/ / / \n"
"| || | / / | | \\/ | \\ \\____| \\ | | \\ / / \n"
"| || | / / |____|_ /\\____|__ /\\______ /_______ / |____|_ / / / \n"
"| || | / / \\/ \\/ \\/ \\/ \\/ / / \n"
"| || | / / / / \n"
"| || | / / / / \n"
"| || | / / / / \n"
"| || | | | / / \n"
"| || | | | / / \n"
"| || | \\ \\ / / \n"
"| || | \\ \\ / / \n"
"\\ \\/ / \\ \\____________________________________________________________________________________/ / \n"
" \\ / \\ / \n"
" \\ / \\ / \n"
" \\ / \\ / \n"
" \\ / \\ / \n"
" \\____________________/ \\_________________________________________________________________________________________________________/ ";
};
#endif // GAME_H