diff --git a/C++/scripts/md5 b/C++/scripts/md5 index d323858..9bf810b 100644 --- a/C++/scripts/md5 +++ b/C++/scripts/md5 @@ -1,6 +1,6 @@ build.sh:ca58f10d4e30d807987ea0105930ae51 - commit.sh:d03a46e721060c22ccb146e19d27e70a - -debug.sh:131aac078fc1ae3c2278209a09e99a3d - +debug.sh:cd1190f874a6f85a7ac7631ef0a00490 - lines.sh:3b907786f7fc9204025993016c9080de - release.sh:0a525311cc14b9c8aefc6f2b816129a1 - temp:d41d8cd98f00b204e9800998ecf8427e - diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 2b2859c..ffa9602 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index 809458e..42f1495 100644 --- a/main.cpp +++ b/main.cpp @@ -1,51 +1,59 @@ #define OLC_PGE_APPLICATION #include "pixelGameEngine.h" -#include + using namespace olc; -struct myStruct{ - std::string name=""; - int level=1; -}; -std::vector> vals; - -void AddVal(std::weak_ptrnewVal) { - auto findVal=std::find_if(vals.begin(),vals.end(), - [&newVal](std::weak_ptr&val) - { - return val.lock()->name==newVal.lock()->name; - } - ); - if (findVal!=vals.end()) { - std::cout<<"Value "<name<<" already exists."<lock()->level++; - std::cout<lock()->name+" is now level "<lock()->level<name<<" does not exist."<name+" is now level "<level< myPtr1=std::make_shared(); - std::shared_ptr myPtr2=std::make_shared(); - std::shared_ptr myPtr3=std::make_shared(); - std::shared_ptr myPtr4=std::make_shared(); + bool OnUserCreate() override + { + box = new Decal(new Sprite("border.png"),false,true); + return true; + } - std::weak_ptr refPtr1=myPtr1; - std::weak_ptr refPtr2=myPtr2; - std::weak_ptr refPtr3=myPtr3; - std::weak_ptr refPtr4=myPtr2; + bool OnUserUpdate(float fElapsedTime) override + { + vd2d boxPos={24,24}; + vd2d boxSize=GetMousePos()-boxPos; + FillRectDecal(boxPos,boxSize,GREY); + DrawBorderBox(boxPos,boxSize); + return true; + } +}; - refPtr1.lock()->name="Test Upgrade 1"; - refPtr2.lock()->name="Test Upgrade 2"; - refPtr3.lock()->name="Test Upgrade 3"; - std::cout<<(refPtr2.lock()==refPtr4.lock())<