Create leaderboards and implement score submission for farthest, fastest, and arcade scores. Update leaderboards every frame, and submit HTTP requests with new scores at a regular interval. Calculate the hash expected by the API to include in each score submission. Track farthest distance reached across all three difficulties. Add function for calculating and storing total distance of all levels combined. The distance of the standard levels is 14,040, so use that value in certain cases where hard-coding is necessary. Add flag that tracks whether the level skip command has been used. Use the flag to disable leaderboard submission and certain achievements. Add function for clearing an arcade score object to reset it to an empty state. Add leaderboards test case to the test program. Call a mock PHP server and mock SQLite database to test leaderboard score submission. Add compilation flag that enables code that uses PHP, so that the test can launch PHP's test server to test the leaderboards API. Collect mock files for the test program into a class, so that they will be cleaned up automatically after each test case runs.
33 lines
883 B
C++
33 lines
883 B
C++
/*@~@~@ |C|A|K|E|F|O|O|T| <presented by> 💫dank.game💫
|
|
|~)~)~)
|
|
|\~*~*| Licensed under the zlib and CC-BY licenses. Source is available at
|
|
|\\~*~|
|
|
,~|#\\~*|~, <https://open.shampoo.ooo/shampoo/cakefoot>
|
|
: \\@\\~| :
|
|
: \\#\\| : Created with open SPACE🪐BOX engine for cross-platform, PC, web and mobile games
|
|
: \\@\' :
|
|
: \\/ : <https://open.shampoo.ooo/shampoo/spacebox>
|
|
`~ ~ ~`~ */
|
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
#include <functional>
|
|
|
|
#include "json/json.hpp"
|
|
#include "cli11/CLI11.hpp"
|
|
|
|
#include "sb.hpp"
|
|
#include "Configuration.hpp"
|
|
#include "Game.hpp"
|
|
#include "Cakefoot.hpp"
|
|
|
|
/*!
|
|
* Create a Cakefoot instance and launch its mainloop.
|
|
*
|
|
* @param argc Count of arguments passed in from the command line
|
|
* @param argv Command line arguments as an array of strings
|
|
* @return Always returns 0
|
|
*/
|
|
int main(int argc, char** argv);
|