Skip to content
This repository was archived by the owner on Jun 12, 2025. It is now read-only.

Commit 781f653

Browse files
author
Patrick Rye
committed
Update to v4.0.0-beta.10
One step forward, two steps back. Renamed a lot of variables to follow naming Notation. Added a short Death animation. Removed some unneeded comments Added Location struct which holds only x and y values. Reworked Player & monster struct with new Locations Base player is now a location Started Code Naming Notation Guide Added blank lines to Compile.bat
1 parent 9d36250 commit 781f653

File tree

15 files changed

+324
-253
lines changed

15 files changed

+324
-253
lines changed

Compile.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ echo Deleting old files...
88
IF EXIST Platformer-Experiment.exe del /F Platformer-Experiment.exe
99
::Delete Stackdump if it exists (so as to not confuse me later)
1010
IF EXIST Platformer-Experiment.exe.stackdump del /F Platformer-Experiment.exe.stackdump
11+
echo.
1112

1213
::Move to the Resources directory
1314
cd %~dp0Resources
1415
echo Compiling Resources...
1516
::Compile the resource files of the icon and boilerplate
1617
windres my_icon.rc -O coff my_icon.res
1718
windres boilerplate.rc -O coff boilerplate.res
19+
echo.
20+
1821

1922
::Move to the source folder
2023
cd %~dp0Source
@@ -38,10 +41,13 @@ g++ -std=c++11 -Wall -g -c tick.cpp
3841
::Move back to the main directory
3942
cd %~dp0
4043

44+
echo.
45+
4146
::Complie everything together!
4247
echo Linking everything together...
4348
g++ -std=c++11 -Wall -g -o Platformer-Experiment.exe %~dp0Source\main.o %~dp0source\config.o %~dp0source\map.o %~dp0source\entity.o %~dp0source\tick.o %~dp0Resources\my_icon.res %~dp0Resources\boilerplate.res
4449

50+
echo.
4551
::Delete all the leftover parts
4652
echo Deleting object files...
4753
IF EXIST %~dp0Resources\boilerplate.res del /F %~dp0Resources\boilerplate.res
@@ -52,6 +58,8 @@ IF EXIST %~dp0Source\map.o del /F %~dp0Source\map.o
5258
IF EXIST %~dp0Source\entity.o del /F %~dp0Source\entity.o
5359
IF EXIST %~dp0Source\tick.o del /F %~dp0Source\tick.o
5460

61+
echo.
62+
5563
echo Done!
5664
::Pause encase there was a complie error to allow user to see what the issue is.
5765
pause
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Notation
2+
3+
This project will use the following naming notation for variables within its code; in an attempt to keep all code clear between different people.
4+
5+
There are expections to using these in cases where the variable is used in a for loop.
6+
7+
This method is slightly based on the [Hungarian Notation] (https://en.wikipedia.org/wiki/Hungarian_notation) but with our own tweaks.
8+
9+
## Scope
10+
11+
| Scope | Prefix | Example |
12+
| ------------- |:-------------------------:|--------------------|
13+
| Global | In Global Namespace or g_ | Global::blnLogging |
14+
| Local | None | strMyString |
15+
| zebra stripes | are neat | |
16+
17+
18+
## Types
19+
20+
| Type | Prefix | Example |
21+
| ------------- |:------:|--------------------|
22+
| Boolean | bln | blnLogging |
23+
| Char | chr | chrNull |
24+
| Float | f | fTempFitness |
25+
| Integer | int/ i | iValue |
26+
| Unsigned Int | uint/u | uintSeed |
27+
| Float | f | fTempFitness |
28+
| Float | f | fTempFitness |
29+
| Float | f | fTempFitness |
30+
| Float | f | fTempFitness |
31+
32+
## Classes / Structs
33+
34+
| Type | Prefix | Example |
35+
| ------------- |:-----------------:|--------------------|
36+
| Class | cls | clsTick |
37+
| Object | abr of class name | tckTick |
38+
| Struct | abr of struct name| plyPlayer |
39+
40+
The abr that should be used should be written in a comment.

Documentation/ToDo.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Improvements to the code can be made as [Issues] (https://github.com/GamerMan779
1212

1313
* Figure out IOS compling
1414

15+
* Finish Naming Notation
16+
1517
~~* Add a brief manual describing what the config file options do, as well as a how to use file.~~ 2015-08-11
1618

1719
~~* Change the Read me so its not so off putting~~ 2015-08-10

Resources/boilerplate.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include <windows.h>
33
/**********************************************************************************************************************************************/
44
//Verison numbering updated with the file.
5-
#define VER_FILEVERSION 4,0,0,78
6-
#define VER_PRODUCTVERSION "4.0.0-beta.9\0"
5+
#define VER_FILEVERSION 4,0,0,90
6+
#define VER_PRODUCTVERSION "4.0.0-beta.10\0"
77
/**********************************************************************************************************************************************/
88
//If this is not commented out it marks that this program verison was not meant to be publicly released.
99
#define PRIVATE

Source/config.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
This holds all the functions related to the config file, its loading, making, and holding the values pulled from the config.
77
*/
88
/**********************************************************************************************************************************************/
9-
Config::Config() {
9+
clsConfig::clsConfig() {
1010
//Set the values as some default value.
1111
values.blnLogging = true;
1212
values.blnShowMap = false;
@@ -20,17 +20,17 @@ Config::Config() {
2020
if (Global::blnDebugMode) {printf("Config Constructor called.\n");}
2121
}
2222
/**********************************************************************************************************************************************/
23-
Config::~Config() {
23+
clsConfig::~clsConfig() {
2424
if(Global::blnDebugMode) {printf("Config Destructor called.\n");}
2525
}
2626
/**********************************************************************************************************************************************/
27-
bool Config::exists(void) {
27+
bool clsConfig::exists(void) {
2828
//Returns true or false if config file exists
2929
std::ifstream infile(FileName);
3030
return infile.good();
3131
}
3232
/**********************************************************************************************************************************************/
33-
void Config::make(void) {
33+
void clsConfig::make(void) {
3434
//Makes the config file
3535
configFile = fopen(FileName,"w");
3636
printf("Config File will now be created!\n");
@@ -61,7 +61,7 @@ void Config::make(void) {
6161
values.uintSeed = 12345;
6262
}
6363
/**********************************************************************************************************************************************/
64-
char Config::verisonCheck(const char *ConfigVerison) {
64+
char clsConfig::verisonCheck(const char *ConfigVerison) {
6565
//This checks the version number written at the top of the config file
6666
//against the internal version number of the program.
6767
//If it finds a Major revision change the config HAS to be replaced.
@@ -79,7 +79,7 @@ char Config::verisonCheck(const char *ConfigVerison) {
7979
else {return USECONFIG;}
8080
}
8181
/**********************************************************************************************************************************************/
82-
void Config::load(void) {
82+
void clsConfig::load(void) {
8383
//Loads all of the config values
8484

8585
char chrTempString[50];
@@ -151,7 +151,7 @@ void Config::load(void) {
151151
printf("\n\n");
152152
}
153153
/**********************************************************************************************************************************************/
154-
void Config::Check(void) {
154+
void clsConfig::Check(void) {
155155
char chrTempString[50], chrConfigVerison;
156156

157157
if (exists() != true) {
@@ -198,11 +198,11 @@ void Config::Check(void) {
198198
} //end if exists
199199
}
200200
/**********************************************************************************************************************************************/
201-
Configures Config::getvalues(void) {
201+
Configures clsConfig::getvalues(void) {
202202
return values;
203203
}
204204
/**********************************************************************************************************************************************/
205-
uint Config::getvalues(uchar Spot) {
205+
uint clsConfig::getvalues(uchar Spot) {
206206
//Returns just one value from the config.
207207
//Useful when I don't need ALL the values.
208208
switch (Spot) {

Source/config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ enum configValueSpot {
3131

3232
typedef struct ConfigValues Configures;
3333
/**********************************************************************************************************************************************/
34-
class Config {
34+
class clsConfig {
3535
private:
3636
//Members
3737
const char* FileName = DEFINED_CONFIG_FILE_NAME;
@@ -46,8 +46,8 @@ class Config {
4646

4747
public:
4848
//Default Constructor
49-
Config();
50-
~Config();
49+
clsConfig();
50+
~clsConfig();
5151

5252
//Functions
5353
void Check(void);

0 commit comments

Comments
 (0)