diff --git a/.idea/.idea.Prog2Engine/.idea/.gitignore b/.idea/.idea.Prog2Engine/.idea/.gitignore new file mode 100644 index 0000000..8249ff7 --- /dev/null +++ b/.idea/.idea.Prog2Engine/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/projectSettingsUpdater.xml +/contentModel.xml +/.idea.Prog2Engine.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.Prog2Engine/.idea/.name b/.idea/.idea.Prog2Engine/.idea/.name new file mode 100644 index 0000000..988920a --- /dev/null +++ b/.idea/.idea.Prog2Engine/.idea/.name @@ -0,0 +1 @@ +Prog2Engine \ No newline at end of file diff --git a/.idea/.idea.Prog2Engine/.idea/encodings.xml b/.idea/.idea.Prog2Engine/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.Prog2Engine/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.Prog2Engine/.idea/indexLayout.xml b/.idea/.idea.Prog2Engine/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.Prog2Engine/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Prog2Engine/.idea/vcs.xml b/.idea/.idea.Prog2Engine/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/.idea.Prog2Engine/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Assets/FuelStation.aseprite b/Assets/FuelStation.aseprite new file mode 100644 index 0000000..695eec5 Binary files /dev/null and b/Assets/FuelStation.aseprite differ diff --git a/Assets/JunkShopStation.aseprite b/Assets/JunkShopStation.aseprite new file mode 100644 index 0000000..e717113 Binary files /dev/null and b/Assets/JunkShopStation.aseprite differ diff --git a/Assets/MineralProcessingStation.aseprite b/Assets/MineralProcessingStation.aseprite new file mode 100644 index 0000000..ee64dd9 Binary files /dev/null and b/Assets/MineralProcessingStation.aseprite differ diff --git a/Assets/RepairStation.aseprite b/Assets/RepairStation.aseprite new file mode 100644 index 0000000..d23f0b6 Binary files /dev/null and b/Assets/RepairStation.aseprite differ diff --git a/Game/Game.cpp b/Game/Game.cpp new file mode 100644 index 0000000..e18b62e --- /dev/null +++ b/Game/Game.cpp @@ -0,0 +1,98 @@ +#include "pch.h" +#include "Game.h" + +Game::Game(const Window& window) + : BaseGame { window } { + Initialize(); +} + +Game::~Game() { + Cleanup(); +} + +void Game::Initialize() { + +} + +void Game::Cleanup() { +} + +void Game::Update(float elapsedSec) { + // Check keyboard state + //const Uint8 *pStates = SDL_GetKeyboardState( nullptr ); + //if ( pStates[SDL_SCANCODE_RIGHT] ) + //{ + // std::cout << "Right arrow key is down\n"; + //} + //if ( pStates[SDL_SCANCODE_LEFT] && pStates[SDL_SCANCODE_UP]) + //{ + // std::cout << "Left and up arrow keys are down\n"; + //} +} + +void Game::Draw() const { + ClearBackground(); +} + +void Game::ProcessKeyDownEvent(const SDL_KeyboardEvent& e) { + //std::cout << "KEYDOWN event: " << e.keysym.sym << std::endl; +} + +void Game::ProcessKeyUpEvent(const SDL_KeyboardEvent& e) { + //std::cout << "KEYUP event: " << e.keysym.sym << std::endl; + //switch ( e.keysym.sym ) + //{ + //case SDLK_LEFT: + // //std::cout << "Left arrow key released\n"; + // break; + //case SDLK_RIGHT: + // //std::cout << "`Right arrow key released\n"; + // break; + //case SDLK_1: + //case SDLK_KP_1: + // //std::cout << "Key 1 released\n"; + // break; + //} +} + +void Game::ProcessMouseMotionEvent(const SDL_MouseMotionEvent& e) { + //std::cout << "MOUSEMOTION event: " << e.x << ", " << e.y << std::endl; +} + +void Game::ProcessMouseDownEvent(const SDL_MouseButtonEvent& e) { + //std::cout << "MOUSEBUTTONDOWN event: "; + //switch ( e.button ) + //{ + //case SDL_BUTTON_LEFT: + // std::cout << " left button " << std::endl; + // break; + //case SDL_BUTTON_RIGHT: + // std::cout << " right button " << std::endl; + // break; + //case SDL_BUTTON_MIDDLE: + // std::cout << " middle button " << std::endl; + // break; + //} + +} + +void Game::ProcessMouseUpEvent(const SDL_MouseButtonEvent& e) { + //std::cout << "MOUSEBUTTONUP event: "; + //switch ( e.button ) + //{ + //case SDL_BUTTON_LEFT: + // std::cout << " left button " << std::endl; + // break; + //case SDL_BUTTON_RIGHT: + // std::cout << " right button " << std::endl; + // break; + //case SDL_BUTTON_MIDDLE: + // std::cout << " middle button " << std::endl; + // break; + //} +} + +void Game::ClearBackground() const { + glClearColor(0.0f, 0.0f, 0.3f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); +} diff --git a/Game/Game.h b/Game/Game.h new file mode 100644 index 0000000..30dbb0e --- /dev/null +++ b/Game/Game.h @@ -0,0 +1,30 @@ +#pragma once +#include "BaseGame.h" + +class Game : public BaseGame +{ +public: + explicit Game(const Window& window); + Game(const Game& other) = delete; + Game& operator=(const Game& other) = delete; + Game(Game&& other) = delete; + Game& operator=(Game&& other) = delete; + // http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override + ~Game(); + + void Update(float elapsedSec) override; + void Draw() const override; + + // Event handling + void ProcessKeyDownEvent(const SDL_KeyboardEvent& e) override; + void ProcessKeyUpEvent(const SDL_KeyboardEvent& e) override; + void ProcessMouseMotionEvent(const SDL_MouseMotionEvent& e) override; + void ProcessMouseDownEvent(const SDL_MouseButtonEvent& e) override; + void ProcessMouseUpEvent(const SDL_MouseButtonEvent& e) override; + +private: + // FUNCTIONS + void Initialize(); + void Cleanup(); + void ClearBackground() const; +}; diff --git a/Game/Game.vcxproj b/Game/Game.vcxproj new file mode 100644 index 0000000..c558494 --- /dev/null +++ b/Game/Game.vcxproj @@ -0,0 +1,164 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {0f40114e-3e0c-4195-b425-91fd5ef586ad} + Game + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)\Libraries\SDLTtf\SDL2_ttf-2.20.2\include;$(SolutionDir)\Libraries\SDLMixer\SDL2_mixer-2.6.3\include;$(SolutionDir)\Libraries\SDLImage\SDL2_image-2.6.3\include;$(SolutionDir)\Libraries\SDLMain\SDL2-2.26.3\include;$(SolutionDir)\Engine;$(IncludePath) + $(SolutionDir)\x64\Debug;$(SolutionDir)\Libraries\SDLTtf\SDL2_ttf-2.20.2\lib\x64;$(SolutionDir)\Libraries\SDLMixer\SDL2_mixer-2.6.3\lib\x64;$(SolutionDir)\Libraries\SDLImage\SDL2_image-2.6.3\lib\x64;$(SolutionDir)\Libraries\SDLMain\SDL2-2.26.3\lib\x64;$(LibraryPath) + BuildCompile + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Create + pch.h + + + Console + true + Engine.lib;%(AdditionalDependencies) + + + + + Copying dll files to executable + + + xcopy "$(SolutionDir)Libraries\SDLMain\SDL2-2.26.3\lib\x64\*.dll" "$(TargetDir)" /y /d +xcopy "$(SolutionDir)Libraries\SDLImage\SDL2_image-2.6.3\lib\x64\*.dll" "$(TargetDir)" /y /d +xcopy "$(SolutionDir)Libraries\SDLMixer\SDL2_mixer-2.6.3\lib\x64\*.dll" "$(TargetDir)" /y /d +xcopy "$(SolutionDir)Libraries\SDLTtf\SDL2_ttf-2.20.2\lib\x64\*.dll" "$(TargetDir)" /y /d +xcopy "$(SolutionDir)Resources\*.*" "$(TargetDir)" /y /d /s + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + + + + + $(TargetDir) + + \ No newline at end of file diff --git a/Game/Game.vcxproj.filters b/Game/Game.vcxproj.filters new file mode 100644 index 0000000..8287ec7 --- /dev/null +++ b/Game/Game.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/Game/main.cpp b/Game/main.cpp new file mode 100644 index 0000000..6315191 --- /dev/null +++ b/Game/main.cpp @@ -0,0 +1,40 @@ +#include "pch.h" +#include +#include "Game.h" + + +void StartHeapControl(); +void DumpMemoryLeaks(); + +int SDL_main(int argv, char** args) { + srand(static_cast(time(nullptr))); + + StartHeapControl(); + + Game* pGame { new Game { Window { "Project name - Name, first name - 1DAEXX", 846.f, 500.f } } }; + pGame->Run(); + delete pGame; + + DumpMemoryLeaks(); + return 0; +} + + +void StartHeapControl() { +#if defined(DEBUG) | defined(_DEBUG) + // Notify user if heap is corrupt + HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); + + // Report detected leaks when the program exits + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); + + // Set a breakpoint on the specified object allocation order number + //_CrtSetBreakAlloc( 156 ); +#endif +} + +void DumpMemoryLeaks() { +#if defined(DEBUG) | defined(_DEBUG) + _CrtDumpMemoryLeaks(); +#endif +} diff --git a/Game/pch.cpp b/Game/pch.cpp new file mode 100644 index 0000000..1730571 --- /dev/null +++ b/Game/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" \ No newline at end of file diff --git a/Game/pch.h b/Game/pch.h new file mode 100644 index 0000000..5b798dc --- /dev/null +++ b/Game/pch.h @@ -0,0 +1,20 @@ +#pragma once +//ML Detection Extension +#ifdef _DEBUG +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#define new DEBUG_NEW +#endif +// SDL and OpenGL Includes +#pragma warning(disable : 26812) +#pragma warning(disable : 4820) +#include +#include +#include +#include +#include + +#pragma warning(default : 26812) +#include "structs.h" diff --git a/Prog2Engine.sln b/Prog2Engine.sln index 580bb05..53a6c2f 100644 --- a/Prog2Engine.sln +++ b/Prog2Engine.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Engine", "Engine\Engine.vcxproj", "{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Game", "Game\Game.vcxproj", "{0F40114E-3E0C-4195-B425-91FD5EF586AD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -21,6 +23,14 @@ Global {5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Release|x64.Build.0 = Release|x64 {5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Release|x86.ActiveCfg = Release|Win32 {5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Release|x86.Build.0 = Release|Win32 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x64.ActiveCfg = Debug|x64 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x64.Build.0 = Debug|x64 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x86.ActiveCfg = Debug|Win32 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x86.Build.0 = Debug|Win32 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x64.ActiveCfg = Release|x64 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x64.Build.0 = Release|x64 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x86.ActiveCfg = Release|Win32 + {0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index acba1ee..fe6205f 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,15 @@
-

NAME OF CHOSEN GAME

+

Motherload

- Short description of the game. + Gather resources and buy upgrades to dig as far as you can. You have to dig ores and sell them to earn cash which you use to buy fuel, digger upgrades, explosives, and other supplies. You can only sell ore and buy items at the surface. If you run out of fuel, your digger explodes and you die (game over). There are more valuable (and heavier) ores as you go deeper into the mine. There are several types of alien artifacts which are of considerable value and appear randomly throughout the mine (below 950 feet).
Original game : - General info » + General info » · - Youtube video » + Youtube video »

@@ -50,9 +50,9 @@ TODO: add screenshot Here's why: TODO: describe why you chose this game -* reason 1 -* reason .. - +* It's a classic game that I played when I was younger. +* It's a game that I can make in a reasonable amount of time. +*

(back to top)

@@ -61,8 +61,8 @@ TODO: describe why you chose this game This section gives a clear and detailed overview of which parts of the original game I planned to make. ### The minimum I will most certainly develop: -* .. -* .. +* Player movement +* Resource Collection ### What I will probably make as well: * .. @@ -82,7 +82,7 @@ Detailed instructions on how to run your game project are in this section. ### Prerequisites This is an example of how to list things you need to use the software and how to install them. -* Visual Studio 2022 +* Visual Studio 2022 Or Jetbrains Rider ### How to run the project @@ -144,9 +144,9 @@ Explain where you applied inheritance (mandatory). ## Contact -Your Name - email@student.howest.be +Bram Verhulst - bram.verhulst@student.howest.be -Project Link: [https://github.com/your_username/repo_name](https://github.com/your_username/repo_name) +Project Link: [Here](https://github.com/HowestDAE/dae16-VerhulstBram)

(back to top)