diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 66be2a1..0fdd5dd 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/Map.cpp b/Map.cpp new file mode 100644 index 0000000..e8dd690 --- /dev/null +++ b/Map.cpp @@ -0,0 +1,6 @@ +#include "Map.h" + +void Map::test(){ + printf("Hello Map\n"); +} + diff --git a/Map.h b/Map.h new file mode 100644 index 0000000..91cd82a --- /dev/null +++ b/Map.h @@ -0,0 +1,10 @@ +#pragma once +#include + +class Player; + +class Map{ + public: + Player*p; + void test(); +}; \ No newline at end of file diff --git a/Player.cpp b/Player.cpp new file mode 100644 index 0000000..716b219 --- /dev/null +++ b/Player.cpp @@ -0,0 +1,6 @@ +#include "Player.h" + +void Player::test(){ + printf("Hello Player\n"); +} + diff --git a/Player.h b/Player.h new file mode 100644 index 0000000..af5d8f0 --- /dev/null +++ b/Player.h @@ -0,0 +1,10 @@ +#pragma once +#include + +class Map; + +class Player{ + public: + Map*map; + void test(); +}; \ No newline at end of file diff --git a/dependentClasses.zip b/dependentClasses.zip new file mode 100644 index 0000000..207b66d Binary files /dev/null and b/dependentClasses.zip differ diff --git a/main.cpp b/main.cpp index b9afec5..9c6678e 100644 --- a/main.cpp +++ b/main.cpp @@ -1,112 +1,14 @@ -#define OLC_PGE_APPLICATION -#include "pixelGameEngine.h" - -class CustomControls : public olc::PixelGameEngine -{ -public: - CustomControls() - { - sAppName = "Configuring Custom Controls"; - } - -private: - - olc::Key MOVE_UP=olc::W; - olc::Key MOVE_DOWN=olc::S; - olc::Key MOVE_RIGHT=olc::D; - olc::Key MOVE_LEFT=olc::A; - - olc::vd2d pos = {0,0}; - - std::array keysList = {"UP","RIGHT","DOWN","LEFT"}; - int configuringKeyIndex = 0; - -public: - - bool OnUserCreate() override - { - return true; - } - - bool OnUserUpdate(float fElapsedTime) override - { - if (GetKey(olc::F1).bPressed) { - TextEntryEnable(true); - configuringKeyIndex=0; - } - - if (TextEntryGetString().size()>0) { - char c = TextEntryGetString()[0]; - olc::Key customKey; - if (c>='a'&&c<='z') { - c-=32; //Capitalize the letter. - customKey=(olc::Key)(c-'A'+1); - } else - if (c>='A'&&c<='Z') { - customKey=(olc::Key)(c-'A'+1); - } else - if (c>='0'&&c<='9') { - customKey=(olc::Key)(c-'0'+olc::Key::K0); - } else - { - return true; - } - - switch (configuringKeyIndex) { - case 0:{ - MOVE_UP=customKey; - }break; - case 1:{ - MOVE_RIGHT=customKey; - }break; - case 2:{ - MOVE_DOWN=customKey; - }break; - case 3:{ - MOVE_LEFT=customKey; - }break; - } - - configuringKeyIndex++; - if (configuringKeyIndextest(); + newMap.p->test(); +} \ No newline at end of file