Skip to content

Commit 2dd0e00

Browse files
__New Features__
- Added support for opening files in Hacker Type Custom in the Hacker command with the Windows File Dialogue. - CarDodge, in the Game command, now has power-ups! When you crash into a special power-up car, a random power-up is selected and activated automatically. These include: an extra life, invincibility, game slow-down, double score, and higher chances for other power-up cars to pop up. These power-up cars have a 5% chance to be created in normal conditions. __Changes and Bugfixes__ - Added syntax in the help messages of the Copy and CopyFile commands, to assist in usability and understanding of the command. - Put all commands in the Help command in a table-style format, to conserve total screen height. - Changed "early alpha build" to "beta build" in the Help command, as this program is getting close to becoming a proper stable release. - The 'How To Play' page in the CarDodge game (in the Game command) has been updated to talk about the power-ups and the power-up cars. - As power-ups have been introduced, CarDodge has reached v0.6.0 and is now in its beta stage, and may skip to version 1.0.0 after a bugfix update at some point. Therefore, the about page in the Help command, and the name of the CarDodge option in the Game command, have been updated to reflect this (the name of the option in the Game command is now just 'CarDodge', as the version is already being listed in the About page of the Help command). - As CarDodge has been merged with ZeeTerminal, the about page in the Help command has been updated to reflect this. - The ScreenNavigate Engine now goes back to the old way of writing directions text to the display - above the actual screen text. This is because having both the "scroll up for more info" and the directions text right next to each other makes them clutter themselves, making the user not be as bothered to read anything that they say. However, the directions text is now centred, making it more prominent to the user.
1 parent 5d85b61 commit 2dd0e00

File tree

13 files changed

+256
-65
lines changed

13 files changed

+256
-65
lines changed

CommandFiles/CalculationAlgorithm/CalculationAlgorithm.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,9 +1020,6 @@ bool CalculationAlgorithm::UseEuropeanNotation(bool bToggleValue) {
10201020
cDecimalPoint = cDefaultDecimalPoint;
10211021
cThousandsSeparator = cDefaultThousandsSeparator;
10221022
break;
1023-
default:
1024-
VerbosityDisplay("In CalculationAlgorithm::UseEuropeanNotation(): ERROR - Unknown value recieved from bToggleValue, therefore setting notation failed. Not true/false (1/0).\n", nObjectID);
1025-
return false;
10261023
}
10271024

10281025
return true;

CommandFiles/CommandFileAssets.cpp

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,24 @@ void help(bool bFromTutorial) {
220220
sneHelp.nSizeOfScreens = 4;
221221
std::string sScreens[] =
222222
{
223-
"___LIST OF COMMANDS___\n\nTo see more about a command, type in \"<command> -h\". This will work for all commands, except: echo and title.\n\n[1] Help\n[2] Exit\n[3] Tutorial\n[4] Echo\n[5] CLS\n[6] DevTools\n[7] CPUStress\n[8] Colour\n[9] Settings\n[10] Title\n[11] Date\n[12] ColourNumbers\n[13] MediaPlayer\n[14] AudioPlayer\n[15] TTS\n[16] Stopwatch\n[17] Read\n[18] Timer\n[19] Beep\n[20] MessageBox\n[21] Copy\n[22] CopyFile\n[23] TextInfo\n[24] ConfigAction\n[25] BeepSounds\n[26] RickRoll\n[27] ShellExecute\n[28] Hacker\n[29] Calculator\n[30] Logoff\n[31] Shutdown\n[32] Reboot (or Restart)\n[33] Hibernate\n[34] ResetExpl\n[35] MemTest\n[36] RandCol\n[37] Pause\n[38] CommandNum\n[39] SlowChar\n[40] ReverseText\n[41] Notes\n[42] FileParse\n[43] Disp\n[44] SysInfo\n[45] Einstein\n[46] Edison\n[47] Tesla\n[48] Cow\n[49] Cat\n[50] Bunny\n[51] Game\n[52] FileCryptor\n[53] Delete\n\nMore will be added soon!\n",
223+
"___LIST OF COMMANDS___\n\nTo see more info about a command, type in \"<command> -h\". This will work for all commands, except: echo and title.\n\n"
224+
"[1] Help\t\t[16] Stopwatch\t\t[31] Shutdown\t\t[46] Edison\n"
225+
"[2] Exit\t\t[17] Read\t\t[32] Reboot\t\t[47] Tesla\n"
226+
"[3] Tutorial\t\t[18] Timer\t\t[33] Hibernate\t\t[48] Cow\n"
227+
"[4] Echo\t\t[19] Beep\t\t[34] ResetExpl\t\t[49] Cat\n"
228+
"[5] CLS\t\t\t[20] MessageBox\t\t[35] MemTest\t\t[50] Bunny\n"
229+
"[6] DevTools\t\t[21] Copy\t\t[36] RandCol\t\t[51] Game\n"
230+
"[7] CPUStress\t\t[22] CopyFile\t\t[37] Pause\t\t[52] FileCryptor\n"
231+
"[8] Colour\t\t[23] TextInfo\t\t[38] CommandNum\t\t[53] Delete\n"
232+
"[9] Settings\t\t[24] ConfigAction\t[39] SlowChar\n"
233+
"[10] Title\t\t[25] BeepSounds\t\t[40] ReverseText\n"
234+
"[11] Date\t\t[26] RickRoll\t\t[41] Notes\n"
235+
"[12] ColourNumbers\t[27] ShellExecute\t[42] FileParse\n"
236+
"[13] MediaPlayer\t[28] Hacker\t\t[43] Disp\n"
237+
"[14] AudioPlayer\t[29] Calculator\t\t[44] SysInfo\n"
238+
"[15] TTS\t\t[30] Logoff\t\t[45] Einstein\n"
239+
240+
"\nMore will be added soon!\n",
224241

225242
"___FREQUENTLY ASKED QUESTIONS___\n\n"
226243
"1) I can't see the terminal text. How can I zoom in?\n 1a) You can zoom in, of course. Press and hold the Ctrl button and scroll with the mouse to your desired text size.\n"
@@ -229,10 +246,10 @@ void help(bool bFromTutorial) {
229246
"\n\n4) What is the difference between the 'old' and 'new' OptionSelect Session styles?\n 4a) The 'old' style is an inspiration from the TerminalAppGen2, the previous iteration of this program. It is very robust, simple and works by associating a number with each option, which you type in and press ENTER to select.\nThe 'new' style isn't exactly new, and has been in ZeeTerminal since v0.1.0. However, it is newer than the 'old' style, hence it's referred to as 'new'. It relies on using the arrow/WS keys to move a highlight up and down, to select an option.\n",
230247

231248
"___ABOUT THIS PROGRAM___\n\nThis is the ZeeTerminal Commandline Program, Build " + std::string(ZT_VERSION) + ".\n" +
232-
"This is an early alpha build of ZeeTerminal, with an entirely new engine and components.\nThis program is made in C++, with a few very small parts of C." +
233-
"\n\nThis program uses the DirectShow API in the MediaPlayer command, which is licensed by Microsoft Corporation. (c) Microsoft Corporation.\n\n" +
234-
"This program uses the BASS API in the AudioPlayer command, which is licensed by Un4Seen Developments. (c) Un4Seen Developments.\n\n" +
235-
"This program uses a slightly modified version of the CarDodge game v0.5.1, accessible in the Game command. CarDodge is licensed under Ryan Zorkot with the MIT License. For more information, visit the repository: https://github.com/rforzachamp821/CarDodge\n\n"
249+
"This is a beta build of ZeeTerminal, with an entirely new engine and components.\nThis program is made in C++, with a few very small parts of C." +
250+
"\n\nThis program uses the DirectShow API in the MediaPlayer command, licensed by Microsoft Corp. (c) Microsoft Corp.\n\n" +
251+
"This program uses the BASS API in the AudioPlayer command, licensed by Un4Seen Developments. (c) Un4Seen Developments.\n\n" +
252+
"This program uses the CarDodge game v0.6.0, accessible in the Game command. CarDodge is licensed under Ryan Zorkot with the MIT License. For more information, visit the repository: https://github.com/rforzachamp821/CarDodge\n\n"
236253
"\nZeeTerminal is licensed under the MIT License. The license and credits can be viewed on Page 4.\n\n"
237254
" _____ _____ _ _ \n"
238255
" |__ /___ __|_ _|__ _ __ _ __ ___ (_)_ __ __ _| |\n"

CommandFiles/CommandHelpMessages.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ namespace helpmsgs
394394
std::cout << "Possible arguments for this command:" << NOULINE_STR;
395395
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
396396
std::cout << wordWrap("\n -h\t\tDisplays this help message.\n <source>\tThe original file to be copied to another file. Put the file directory in place of <source>.\n <dest>\t\tThe file directory of the new/existing file. Put the file directory in place of <dest>.")
397+
<< wordWrap("\n\nSyntax: copyfile <source> <dest> (in this exact order).")
397398
<< wordWrap("\n\nExample: copyfile \"C:\\test\\a file.txt\" C:\\Users\\newfile.txt")
398399
<< wordWrap("\n\nNOTE: For any directory with spaces, use quotes like in the example.\nNOTE: You must have both the source and the destination directories when using them as arguments.\nNOTE: Read this article for information on the different forms of filepaths: ");
399400

@@ -422,6 +423,7 @@ namespace helpmsgs
422423
std::cout << wordWrap("\n -h\t\tDisplays this help message.\n -o\t\tEnable overwrite mode. Any existing file with the same filename as the file to copy will be overwritten when specified."
423424
"\n -d\t\tEnable folder copy mode. When a folder is specified as a source, the contents of that folder will be recursively copied to the destination."
424425
"\n <source>\tThe file to copy. Put the file directory in place of <source>.\n <dest>\t\tThe destination location/directory. Put the directory path in place of <dest>.\n\n"
426+
"Syntax: copy <source <dest> (in this exact order).\n\n"
425427
"Example: copy \"C:\\test\\a file.txt\" C:\\Users\n\n"
426428
"NOTE: For any directory with spaces, use quotes like in the example.\nNOTE: You must have both the source and the destination directories when using them as arguments.\nNOTE: Read this article for information on the different forms of filepaths: ");
427429

@@ -549,7 +551,7 @@ namespace helpmsgs
549551
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
550552
std::cout << wordWrap("\n -h\t\tDisplays this help message.\n -i\t\tStart immediately, with default settings when no argument is given.\n --display\tStarts the hacking text part of this command.\n --type\t\tStarts the hacker typing part of this command.\n --typecustom\tStarts the hacker typing part of this command, with custom file output abilities.\n <speed>\tSpeed of output characters for 'type' and 'typecustom' arguments. Must be a number.\n <filepath>\tCustom filepath argument for 'typecustom' argument. Must be a valid filepath.")
551553
<< wordWrap("\n\nSyntax for '--type' argument:\t\t --type <speed>\nSyntax for '--typecustom' argument:\t --typecustom <filepath> <speed> (In order)")
552-
<< wordWrap("\n\nExample: hacker --type\n\n");
554+
<< wordWrap("\n\nExample: hacker --type\n\nNOTE: When using the --typecustom argument, in the <filepath> argument, you can use \"*open\" without quotes to use the Windows File Dialogue to open files.\n\n");
553555

554556
return;
555557
}

CommandFiles/CommandsFiles/CommandsFile_21to30.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,12 +816,25 @@ bool commands::Commands21To30(const std::string sCommand, char* cCommandArgs, co
816816
}
817817

818818
if (sFileName == "") {
819-
sFileName = StrInput("Please input the filepath for the custom file (0 to exit): > ");
819+
sFileName = StrInput("Please input the filepath for the custom file (0 to exit, *open for Windows File Dialogue): > ");
820820
if (sFileName == "0") {
821821
Exiting();
822822
return true;
823823
}
824824
}
825+
826+
// Open file with Windows File Dialogue
827+
if (sFileName == "*open") {
828+
// Use the Windows File Dialogue
829+
std::cout << wordWrap("Opening with the Windows File Dialogue...\n");
830+
FileOpenGUIEngine HackerFileOpen;
831+
HackerFileOpen.FileOpenDialogue("Open a File to Use for Hacker Type");
832+
sFileName = HackerFileOpen.GetRetrievedPathName();
833+
if (sFileName == "") {
834+
Exiting();
835+
return true;
836+
}
837+
}
825838

826839
if (bStartImmediately == false) {
827840
std::cout << '\n';

CommandFiles/CommandsFiles/CommandsFile_51to60.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bool commands::Commands51To60(const std::string sCommand, char* cCommandArgs, co
3535
OptionSelectEngine oseGame;
3636
oseGame.nSizeOfOptions = 1;
3737
std::string sOptions[] = {
38-
"Car Dodge (v0.5.1)"
38+
"Car Dodge"
3939
};
4040
oseGame.sOptions = sOptions;
4141

Core/ZTConstDefinitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
// ZeeTerminal Source Code Version
4-
constexpr const char* ZT_VERSION = "0.6.0";
4+
constexpr const char* ZT_VERSION = "0.7.0";
55

66
// Array size for all argument arrays
77
constexpr int nArgArraySize = 128;

Engine/ScreenNavigateEngine/ScreenNavigateEngine.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,19 @@ void ScreenNavigateEngine::ScreenNavigate(std::string sTitle) {
6969
std::string sPageNum = "~~PAGE NUMBER: " + std::to_string(nIndex) + "/" + std::to_string(nNumberOfScreens) + "~~\n";
7070
CentreColouredText(sPageNum, 2);
7171

72-
// Output correct screen
73-
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
74-
std::cout << wordWrap(sScreens[nIndex - 1]) << '\n';
75-
7672
// Output directions of use using DirectionsDisplay()
7773
if (ConfigObjMain.bDisplayDirections) {
7874
std::cout << '\n';
79-
DirectionsDisplay(sDirectionsText);
75+
DirectionsDisplay(sDirectionsText, true);
8076
std::cout << '\n';
8177
}
8278

79+
// Output correct screen
80+
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
81+
std::cout << wordWrap(sScreens[nIndex - 1]) << '\n';
82+
83+
84+
8385
// Check ending cursor height to see if scroll-up message should be outputted
8486
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbiScreenNavigate);
8587
if (csbiScreenNavigate.dwCursorPosition.Y >= csbiScreenNavigate.srWindow.Bottom - csbiScreenNavigate.srWindow.Top) {

GameFiles/CarDodge/CarDodge.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ bool VerifyIfGameIsRunnable(bool, bool);
1515
extern CarInfo EnemyCars[128];
1616
extern CarInfo UserCar;
1717
extern const int nEnemyCarArraySize;
18-
CarStyles Style;
1918

2019
// Menu colours
2120
std::string sMenuColourFore = LWHT;
@@ -32,28 +31,28 @@ void InitialiseCarDodge()
3231

3332
// Initialise EnemyCars array
3433
for (int i = 0; i < nEnemyCarArraySize; i++) {
35-
EnemyCars[i].CarStyle = Style.EnemyCar;
34+
EnemyCars[i].CarStyle = CarStyles::EnemyCar;
3635
}
3736

3837
// Initialise user car style to what configuration object indicates
3938
switch (ConfigObjMain.nCarDodgeGameStartupCar) {
4039
case 1:
41-
UserCar.CarStyle = Style.UserCarDefault;
40+
UserCar.CarStyle = CarStyles::UserCarDefault;
4241
break;
4342
case 2:
44-
UserCar.CarStyle = Style.HoverRocket;
43+
UserCar.CarStyle = CarStyles::HoverRocket;
4544
break;
4645
case 3:
47-
UserCar.CarStyle = Style.TheSweeper;
46+
UserCar.CarStyle = CarStyles::TheSweeper;
4847
break;
4948
case 4:
50-
UserCar.CarStyle = Style.TheSlicer;
49+
UserCar.CarStyle = CarStyles::TheSlicer;
5150
break;
5251
case 5:
53-
UserCar.CarStyle = Style.GTSpeed;
52+
UserCar.CarStyle = CarStyles::GTSpeed;
5453
break;
5554
case 6:
56-
UserCar.CarStyle = Style.XtraAero;
55+
UserCar.CarStyle = CarStyles::XtraAero;
5756
break;
5857
}
5958

@@ -128,8 +127,8 @@ inline void RenderMainMenuCars() {
128127
nDirectionsTextRightColumn = nScreenCentre + 27; // 27 is half of 54
129128

130129
// Set car styles
131-
ciMainMenuUserCar.CarStyle = Style.UserCarDefault;
132-
ciMainMenuEnemyCar.CarStyle = Style.EnemyCar;
130+
ciMainMenuUserCar.CarStyle = CarStyles::UserCarDefault;
131+
ciMainMenuEnemyCar.CarStyle = CarStyles::EnemyCar;
133132

134133
// Set up left side of main menu
135134
ciMainMenuUserCar.bottomLeft = { short(nDirectionsTextLeftColumn - 10), 14 };
@@ -142,7 +141,7 @@ inline void RenderMainMenuCars() {
142141

143142
// Set up right side of main menu
144143
ciMainMenuUserCar.bottomLeft = { short(nDirectionsTextRightColumn + 6), 14 };
145-
ciMainMenuUserCar.CarStyle = Style.XtraAero;
144+
ciMainMenuUserCar.CarStyle = CarStyles::XtraAero;
146145

147146
ciMainMenuEnemyCar.bottomLeft = { short(nDirectionsTextRightColumn + 11), 11 };
148147

GameFiles/CarDodge/CarDodge_CodeFiles/CarDodgeCore/CarDodgeCore.cpp

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ void CarDodgeCore::RenderBorders(std::string sSetBorderColourFore, std::string s
127127

128128
}
129129

130+
// Reset colours and exit
130131
colour(ConfigObjMain.sColourGlobal, ConfigObjMain.sColourGlobalBack);
131132

132133
return;
@@ -171,6 +172,8 @@ void CarDodgeCore::MoveUserCarRight() {
171172
// RenderNewEnemyCar
172173
void CarDodgeCore::RenderNewEnemyCar() {
173174
static std::uniform_int_distribution<short int> Dist(nLeftBorderWidth, nScreenWidth - nRightBorderWidth - 4);
175+
static std::uniform_int_distribution<short int> DistPowerUpCar(1, 100);
176+
static std::random_device rdRandNum;
174177

175178
// Too many rendered enemy cars at once
176179
if (nNumOfCurrentRenderedEnemyCars > 128) return;
@@ -186,6 +189,15 @@ void CarDodgeCore::RenderNewEnemyCar() {
186189
nRandomXCoord += 3;
187190
EnemyCars[nEnemyCarIndex].bottomRight = { nRandomXCoord, 3 };
188191

192+
// Set the car to be a power-up car if random number is between 1 and nChanceForPowerUpCarMultiplier * 5 inclusive (5 because 1x is 5% chance for power-up car to appear)
193+
short int nPowerUpCarChanceCheck = DistPowerUpCar(rdRandNum);
194+
if (nPowerUpCarChanceCheck > 0 && nPowerUpCarChanceCheck < 1 + 5 * nChanceForPowerUpCarMultiplier) {
195+
// Set car design to power-up car
196+
EnemyCars[nEnemyCarIndex].CarStyle = CarStyles::PowerUpCar;
197+
// Attribute the car to be a power-up car
198+
EnemyCars[nEnemyCarIndex].bIsPowerUpCar = true;
199+
}
200+
189201
// Render the new car now
190202
RenderCar(EnemyCars[nEnemyCarIndex]);
191203

@@ -211,6 +223,21 @@ void CarDodgeCore::MoveAllEnemyCars() {
211223
}
212224
}
213225

226+
void CarDodgeCore::DeleteEnemyCarAndResetSafely(int nEnemyCarArrayIndex) {
227+
// Erase car
228+
EraseCar(EnemyCars[nEnemyCarArrayIndex]);
229+
230+
// Reset car to defaults
231+
EnemyCars[nEnemyCarArrayIndex].bInUse = false;
232+
EnemyCars[nEnemyCarArrayIndex].bottomLeft = { 0,0 };
233+
EnemyCars[nEnemyCarArrayIndex].bottomRight = { 0,0 };
234+
if (EnemyCars[nEnemyCarArrayIndex].bIsPowerUpCar) EnemyCars[nEnemyCarArrayIndex].CarStyle = CarStyles::EnemyCar;
235+
EnemyCars[nEnemyCarArrayIndex].bIsPowerUpCar = false;
236+
237+
// Index is inactive - enemy car no longer existent, so decrement nNumOfCurrentRenderedEnemyCars by 1
238+
nNumOfCurrentRenderedEnemyCars--;
239+
}
240+
214241
// DeleteEnemyCarOnLowerBorderHit
215242
bool CarDodgeCore::DeleteEnemyCarOnLowerBorderHit() {
216243
for (int nEnemyCarIterator = 0; nEnemyCarIterator < nEnemyCarArraySize; nEnemyCarIterator++) {
@@ -219,14 +246,8 @@ bool CarDodgeCore::DeleteEnemyCarOnLowerBorderHit() {
219246

220247
// Check if found enemy car is touching lower border
221248
if (EnemyCars[nEnemyCarIterator].bottomLeft.Y >= nSessionConsoleHeight) {
222-
// Erase car
223-
EraseCar(EnemyCars[nEnemyCarIterator]);
224-
225-
// Reset car to defaults
226-
EnemyCars[nEnemyCarIterator].bInUse = false;
227-
EnemyCars[nEnemyCarIterator].bottomLeft = { 0,0 };
228-
EnemyCars[nEnemyCarIterator].bottomRight = { 0,0 };
229-
nNumOfCurrentRenderedEnemyCars--;
249+
// Delete Enemy Car
250+
DeleteEnemyCarAndResetSafely(nEnemyCarIterator);
230251

231252
// Because of how cars are rendered one-by-one, we shouldn't expect another car touching the border at this moment, so exit
232253
return true;
@@ -237,7 +258,8 @@ bool CarDodgeCore::DeleteEnemyCarOnLowerBorderHit() {
237258
}
238259

239260
// CheckForCarCollision
240-
bool CarDodgeCore::CheckForCarCollision() {
261+
// nEnemyCarIteratorValOut - out pointer to int variable containing exact index of colliding enemy car if collision detected
262+
bool CarDodgeCore::CheckForCarCollision(int* nEnemyCarIteratorValOut) {
241263
// Reiterate through all enemy cars to check each one for crash
242264
for (int nEnemyCarIterator = 0; nEnemyCarIterator < nEnemyCarArraySize; nEnemyCarIterator++) {
243265
// Don't attempt to check if enemy car is not in use
@@ -247,6 +269,7 @@ bool CarDodgeCore::CheckForCarCollision() {
247269
if (EnemyCars[nEnemyCarIterator].bottomLeft.Y >= nSessionConsoleHeight - 3) {
248270
// Check if car is in the necessary X-coordinates to be in a crash
249271
if (EnemyCars[nEnemyCarIterator].bottomLeft.X <= UserCar.bottomRight.X && EnemyCars[nEnemyCarIterator].bottomRight.X >= UserCar.bottomLeft.X) {
272+
*nEnemyCarIteratorValOut = nEnemyCarIterator;
250273
return true;
251274
}
252275
}

GameFiles/CarDodge/CarDodge_CodeFiles/CarDodgeCore/CarDodgeCore.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class CarDodgeCore
2929
short int nNumOfCurrentRenderedEnemyCars = 0; // Symbolises the number of rendered enemy cars currently being rendered on screen
3030
std::mt19937_64 RandEngine; // Random number generation engine
3131
bool bCarDodgeCoreInitialised = false; // Indicator to show if game is initialised or not
32-
3332
bool bSyncWithStdioPrevious = true; // Previous stdio sync value
3433

3534
// Keys for encryption and decryption for High Scores (This is just a small game - there is no need to go balls-to-the-wall with encrypting hardcoded keys)
@@ -54,6 +53,7 @@ class CarDodgeCore
5453

5554
uint64_t nCurrentPointsHighScore = 0;
5655

56+
short int nChanceForPowerUpCarMultiplier = 1; // 1 for 1x chance, 2 for 2x chance, 3 for 3x chance, etc.
5757

5858
// UninitialiseCarDodgeCore - Uninitialise the CarDodge Core.
5959
// No parameters or return values.
@@ -102,6 +102,9 @@ class CarDodgeCore
102102
// MoveAllEnemyCars
103103
void MoveAllEnemyCars();
104104

105+
// DeleteEnemyCarAndResetSafely
106+
void DeleteEnemyCarAndResetSafely(int nEnemyCarArrayIndex);
107+
105108
// DeleteEnemyCarOnLowerBorderHit
106109
// Return Values: TRUE or 1 for enemy car deleted, FALSE or 0 for no enemy car deleted.
107110
bool DeleteEnemyCarOnLowerBorderHit();
@@ -110,7 +113,7 @@ class CarDodgeCore
110113
// Parameters: None
111114
// Return values: TRUE or 1 for collision occured, FALSE or 0 for no collision occured.
112115
//
113-
bool CheckForCarCollision();
116+
bool CheckForCarCollision(int* nEnemyCarIteratorValOut = nullptr);
114117

115118
// CentreTextCarDodge - The CentreText() function, but tuned to centre text between the left and right game borders.
116119
// - The text is centred using spaces, and then returned as an updated string.

0 commit comments

Comments
 (0)