diff --git a/Crawler/C++/scripts/web.sh b/Crawler/C++/scripts/web.sh index b575188d..c1d7b984 100755 --- a/Crawler/C++/scripts/web.sh +++ b/Crawler/C++/scripts/web.sh @@ -12,12 +12,12 @@ source ../emsdk/emsdk_env.sh if [ ! -f "pixelGameEngine_wasm.o" ] then printf "Pixel Game Engine compile object missing. Compiling for the first time..." - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 -c pixelGameEngine.cpp -o pixelGameEngine_wasm.o + em++ -std=c++20 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 -c pixelGameEngine.cpp -o pixelGameEngine_wasm.o fi if [ -d "assets" ]; then - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html --preload-file ./assets + em++ -std=c++20 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html --preload-file ./assets else - em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html + em++ -std=c++20 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_SDL_MIXER=2 -s USE_LIBPNG=1 $(find . -type f -name "*.cpp" -not -path "./test/*" -not -name "pixelGameEngine.cpp") pixelGameEngine_wasm.o -o ${PROJECT_NAME}.html fi cp buildtemplate.html ${PROJECT_NAME}.html diff --git a/Crawler/Monster.cpp b/Crawler/Monster.cpp index 51ceb16d..2cd29d38 100644 --- a/Crawler/Monster.cpp +++ b/Crawler/Monster.cpp @@ -386,16 +386,16 @@ void Monster::Set(_ATTRIBUTE a,std::variant<VARIANTS>val){ //Error handling below! //The idea is if we cannot retrieve the value, the program errors out. switch(a.type){ - case Attribute::TYPE::FLOAT:{ + case ATTRIBUTE_TYPE::FLOAT:{ GetFloat(a); }break; - case Attribute::TYPE::INT:{ + case ATTRIBUTE_TYPE::INT:{ GetInt(a); }break; - case Attribute::TYPE::STRING:{ + case ATTRIBUTE_TYPE::STRING:{ GetString(a); }break; - case Attribute::TYPE::BOOL:{ + case ATTRIBUTE_TYPE::BOOL:{ GetBool(a); }break; } diff --git a/Crawler/MonsterAttribute.cpp b/Crawler/MonsterAttribute.cpp new file mode 100644 index 00000000..a54ab993 --- /dev/null +++ b/Crawler/MonsterAttribute.cpp @@ -0,0 +1,4 @@ +#include "MonsterAttribute.h" + +_ATTRIBUTE Attribute::IFRAME_TIME_UPON_HIT{ATTRIBUTE_TYPE::FLOAT}; +_ATTRIBUTE Attribute::SHOOT_RING_TIMER{ATTRIBUTE_TYPE::FLOAT}; \ No newline at end of file diff --git a/Crawler/MonsterAttribute.h b/Crawler/MonsterAttribute.h index e6d62fbb..9f0bfb3a 100644 --- a/Crawler/MonsterAttribute.h +++ b/Crawler/MonsterAttribute.h @@ -1,20 +1,21 @@ +#pragma once #define VARIANTS float,int,std::string,bool -#define CREATE_ATTRIBUTE(variable,type) _ATTRIBUTE variable{Attribute::TYPE::type}; -namespace Attribute{ - enum class TYPE{ - FLOAT, - INT, - STRING, - BOOL, - }; -} +enum class ATTRIBUTE_TYPE{ + FLOAT, + INT, + STRING, + BOOL, +}; struct _ATTRIBUTE{ - Attribute::TYPE type; + ATTRIBUTE_TYPE type; + bool operator<(const _ATTRIBUTE&rhs)const{ + return int(type)<int(rhs.type); + } }; -namespace Attribute{ - CREATE_ATTRIBUTE(IFRAME_TIME_UPON_HIT,FLOAT); - CREATE_ATTRIBUTE(SHOOT_RING_TIMER,FLOAT); -} \ No newline at end of file +struct Attribute{ + static _ATTRIBUTE IFRAME_TIME_UPON_HIT; + static _ATTRIBUTE SHOOT_RING_TIMER; +}; \ No newline at end of file diff --git a/Crawler/SlimeKing.cpp b/Crawler/SlimeKing.cpp index 4a010c46..b3754c88 100644 --- a/Crawler/SlimeKing.cpp +++ b/Crawler/SlimeKing.cpp @@ -12,7 +12,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe case 0:{ m.size=ConfigInt("Phase1.Size")/100; m.diesNormally=false; - m.Set(Attribute::IFRAME_TIME_UPON_HIT,0.f); + m.Set(Attribute::IFRAME_TIME_UPON_HIT,0); m.iframe_timer=ConfigFloat("Phase5.IframeTimePerHit"); m.phase=1; }break; diff --git a/Crawler/assets/config/configuration.txt b/Crawler/assets/config/configuration.txt index 30bc0452..d86603c8 100644 --- a/Crawler/assets/config/configuration.txt +++ b/Crawler/assets/config/configuration.txt @@ -10,7 +10,7 @@ gfx_config = gfx/gfx.txt map_config = levels.txt # Starting map when loading the game. -starting_map = CAMPAIGN_1_1 +starting_map = BOSS_1 # Player Properties Loading Config player_config = Player.txt diff --git a/Crawler/sig b/Crawler/sig index 2d0f4fb7..d0422560 100755 --- a/Crawler/sig +++ b/Crawler/sig @@ -1,4 +1,4 @@ -export AUTO_UPDATE=true +export AUTO_UPDATE=false source utils/define.sh