diff --git a/Sounds/car.wav b/Sounds.wagon.wav similarity index 100% rename from Sounds/car.wav rename to Sounds.wagon.wav diff --git a/src/audio.cc b/src/audio.cc index 5ea5a4e..c965e6d 100644 --- a/src/audio.cc +++ b/src/audio.cc @@ -85,9 +85,9 @@ bool Audio::Init() Utils::GetPath(PathFile); Sound[sExpand] = Mix_LoadWAV(PathFile); - strcpy(PathFile, "Sounds/car.wav"); + strcpy(PathFile, "Sounds/wagon.wav"); Utils::GetPath(PathFile); - Sound[sCar] = Mix_LoadWAV(PathFile); + Sound[sWagon] = Mix_LoadWAV(PathFile); strcpy(PathFile, "Sounds/shrink.wav"); Utils::GetPath(PathFile); diff --git a/src/audio.h b/src/audio.h index 2646c7e..dc352a6 100644 --- a/src/audio.h +++ b/src/audio.h @@ -35,7 +35,7 @@ enum eSound { sEnd, sLose, sExpand, - sCar, + sWagon, sShrink, sLive, sSize diff --git a/src/editor.cc b/src/editor.cc index a573d2b..fad4486 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -157,8 +157,8 @@ eMenu Editor::SDLMain(int LevelNumber) } m_level.T[NumN].T[cy * LT + cx] = TypeB; break; - case car: - m_level.T[NumN].T[cy * LT + cx] = C_Car; + case wagon: + m_level.T[NumN].T[cy * LT + cx] = C_Wagon; break; case expander: m_level.T[NumN].T[cy * LT + cx] = C_Expand; @@ -249,8 +249,8 @@ void Editor::Draw() const // Display possible sprites for (i = 0; i < LT * HT; i++) { switch (T[i]) { - case C_Car: // Car sprite - Sprites[car].Draw(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); + case C_Wagon: // Wagon sprite + Sprites[wagon].Draw(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); break; case C_Expand: // Expand sprite Sprites[expander].Draw(i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2, 25); @@ -286,7 +286,7 @@ void Editor::Draw() const // Displays selected option in the menu switch (Option) { case rail: - case car: + case wagon: case expander: case shrinker: case speed: @@ -411,7 +411,7 @@ void Editor::GetKeyPress(int Key) Option = rail; break; case 'z': - Option = car; + Option = wagon; break; case 'e': Option = expander; diff --git a/src/game.cc b/src/game.cc index b8938d0..658559b 100644 --- a/src/game.cc +++ b/src/game.cc @@ -528,8 +528,8 @@ void Game::DisplayScreen() // Display options for (i = 0; i < LT * HT; i++) { switch (T[i]) { - case C_Car: // if car sprite - m_screen.PrintSprite(car, (GameClock * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); + case C_Wagon: // if wagon sprite + m_screen.PrintSprite(wagon, (GameClock * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); break; case C_Expand: // if expander sprite m_screen.PrintSprite(expander, (GameClock * 40 / 1000 + i * 7) % 50, i % LT * D_Case + D_Case / 2, i / LT * D_Case + D_Case / 2); diff --git a/src/loco.cc b/src/loco.cc index f21e5dd..e939560 100644 --- a/src/loco.cc +++ b/src/loco.cc @@ -118,7 +118,7 @@ void Loco::Display(Screen &screen) int cdx, cdy, cfx = 0, cfy = 0; // Attachment point for cables float lv; - // Display all wagon/(cars) + // Display all wagon for (i = 0; i < NWagon; i++) { // Search wagon points switch (Wagon[i]) { @@ -135,7 +135,7 @@ void Loco::Display(Screen &screen) lv = 20; } - // Calculate cars point's position + // Calculate wagons point's position FindPoint(D - p1, x1, y1); FindPoint(D - p2, x2, y2); @@ -186,7 +186,7 @@ void Loco::Display(Screen &screen) // Displays the cable screen.PrintCable(cdx, cdy, cfx, cfy); } - // Calculate the attachment point for the next Wagon/car + // Calculate the attachment point for the next Wagon cfx = x1 - (int)(sin(ar + M_PI) * lv); cfy = y1 - (int)(cos(ar + M_PI) * lv); @@ -222,7 +222,7 @@ void Loco::Display(Screen &screen) } } - // Add gap between the wagons/cars + // Add gap between the wagons ltrain += Pref.WagonGap; } } @@ -240,15 +240,15 @@ void Loco::TestTile(float Dist, long GameDuration, int *Level) if (D <= DMoy && D + Dist >= DMoy) { // Check if on an item switch (Level[T[LocoPos].P]) { - case C_Car: // New wagon/car - m_audio.Play(sCar); + case C_Wagon: // New wagon + m_audio.Play(sWagon); Level[T[LocoPos].P] = 1; // Remove item from level Pref.Score += 5; AddLoco(); // Add a random wagon Win = true; // Check if it was the last wagon for win condition for (i = 0; i < LT * HT; i++) { - if (Level[i] == C_Car) { + if (Level[i] == C_Wagon) { Win = false; } } @@ -291,7 +291,7 @@ void Loco::TestTile(float Dist, long GameDuration, int *Level) break; } - // Collision check with another wagon/car + // Collision check with another wagon for (i = 1; i < NWagon; i++) { vx = (float)(PosWagon[i].dx - PosWagon[0].dx); vy = (float)(PosWagon[i].dy - PosWagon[0].dy); @@ -663,9 +663,9 @@ void Loco::FindPoint(float Dist, int &x, int &y) /*********************************************/ void Loco::AddLoco() { - Wagon[NWagon] = (e_Sprite)(rand() % (car - logs_wagon) + logs_wagon); + Wagon[NWagon] = (e_Sprite)(rand() % (wagon - logs_wagon) + logs_wagon); if (Wagon[NWagon] == Wagon[NWagon - 1]) { // Avoids adding the same sprite twice - if (Wagon[NWagon] + 1 == car) { + if (Wagon[NWagon] + 1 == wagon) { Wagon[NWagon] = logs_wagon; } else { diff --git a/src/loco.h b/src/loco.h index aeab20f..e05b044 100644 --- a/src/loco.h +++ b/src/loco.h @@ -58,7 +58,7 @@ class Loco void MoveForward(int Duration, long GameDuration, int *Key, int *Level); // Makes locomotive move forward for Duration in ms void FindArrow(int *Level, int *Key); // Search the position of the next intersection bool TestDir(int FDir, int *Level); // Check if a direction/turn is possible - void AddLoco(); // Adds a random car to the locomotive + void AddLoco(); // Adds a random wagon to the locomotive inline bool Go(int FutureDirection); // Move the locomotive inline void FindPoint(float Dist, int &x, int &y); // Searching a point on the map diff --git a/src/preference.h b/src/preference.h index f2f9eac..7087b6c 100644 --- a/src/preference.h +++ b/src/preference.h @@ -58,7 +58,7 @@ /*** Possible pieces on the level ***/ #define C_None 0 #define C_Rail 1 -#define C_Car 2 +#define C_Wagon 2 #define C_Expand 3 #define C_Shrink 4 #define C_Speed 5 diff --git a/src/sprite.h b/src/sprite.h index 7ce3117..58ac834 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -50,7 +50,7 @@ enum e_Sprite { cargo_wagon, engine_wagon, cistern_wagon, - car, + wagon, expander, shrinker, speed,