diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 89aeb197..0de0f7a8 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -659,12 +659,15 @@ void AiL::UpdateBullets(float fElapsedTime){ } std::erase_if(BULLET_LIST,[](std::unique_ptr&b){return b->dead;}); } -void AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z){ +const MonsterHurtList AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z){ + MonsterHurtList hitList; for(Monster&m:MONSTER_LIST){ if(geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){ - m.Hurt(damage,upperLevel,z); + HurtReturnValue returnVal=m.Hurt(damage,upperLevel,z); + hitList.push_back({&m,returnVal}); } } + return hitList; } void AiL::PopulateRenderLists(){ diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index f57be5bf..485c9149 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -59,6 +59,9 @@ All rights reserved. #define CreateBullet(type) BULLET_LIST.push_back(std::make_unique(type #define EndBullet )); +using HurtReturnValue=bool; +using MonsterHurtList=std::vector>; + class AiL : public olc::PixelGameEngine { friend class GameState; @@ -150,7 +153,7 @@ public: void AddEffect(std::unique_ptrforeground,std::unique_ptrbackground); //If back is true, places the effect in the background void AddEffect(std::unique_ptrforeground,bool back=false); - void HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z); + const MonsterHurtList HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z); vf2d GetWorldMousePos(); bool LeftHeld(); bool RightHeld(); diff --git a/Adventures in Lestoria/Animation.cpp b/Adventures in Lestoria/Animation.cpp index fae83459..b53b422a 100644 --- a/Adventures in Lestoria/Animation.cpp +++ b/Adventures in Lestoria/Animation.cpp @@ -233,8 +233,6 @@ void sig::Animation::InitializeAnimations(){ CreateHorizontalAnimationSequence("lightning_splash_effect.png",5,{24,24}); - CreateHorizontalAnimationSequence("monsters/Slime King - Cast.png",10,{24,24},{0.04f}); - CreateStillAnimation("meteor.png",{192,192}); for(int i=0;i<5;i++){ diff --git a/Adventures in Lestoria/Bear.cpp b/Adventures in Lestoria/Bear.cpp index a7a2b776..3e7a6e12 100644 --- a/Adventures in Lestoria/Bear.cpp +++ b/Adventures in Lestoria/Bear.cpp @@ -45,13 +45,62 @@ All rights reserved. INCLUDE_game INCLUDE_BULLET_LIST +INCLUDE_GFX +INCLUDE_MONSTER_LIST +INCLUDE_MONSTER_DATA using A=Attribute; void Monster::STRATEGY::BEAR(Monster&m,float fElapsedTime,std::string strategy){ switch(m.I(A::PHASE)){ case 0:{ - + float distToPlayer=geom2d::line(m.GetPos(),game->GetPlayer()->GetPos()).length(); + if(distToPlayer(m.GetPos(),game->GetPlayer()->GetPos()).vector(); + m.SetStrategyDrawFunction([&](AiL*game){ + if(m.IsAlive()){ + game->view.DrawRotatedDecal(m.GetPos()+m.V(A::LOCKON_POS),GFX["range_indicator.png"].Decal(),0.f,{12.f,12.f},vf2d{_GetFloat(m,"Smash Attack Diameter",MONSTER_DATA[m.GetName()].GetAIStrategy()),_GetFloat(m,"Smash Attack Diameter",MONSTER_DATA[m.GetName()].GetAIStrategy())}/100.f,{255,255,0,160}); + } + }); + m.RotateTowardsPos(m.GetPos()+m.V(A::LOCKON_POS)); + }else{ + m.target=game->GetPlayer()->GetPos(); + RUN_TOWARDS(m,fElapsedTime,"Run Towards"); + } + }break; + case 1:{ + m.F(A::CASTING_TIMER)=std::max(0.f,m.F(A::CASTING_TIMER)-fElapsedTime); + if(m.F(A::CASTING_TIMER)==0.f){ + m.I(A::PHASE)=2; + m.F(A::CASTING_TIMER)=ConfigFloat("Attack Animation Wait Time"); + m.PerformOtherAnimation(0); + } + }break; + case 2:{ + m.F(A::CASTING_TIMER)=std::max(0.f,m.F(A::CASTING_TIMER)-fElapsedTime); + if(m.F(A::CASTING_TIMER)==0.f){ + SoundEffect::PlaySFX("Bear Slam Attack",m.GetPos()+m.V(A::LOCKON_POS)); + m.I(A::PHASE)=0; + geom2d::circleattackCircle={m.GetPos()+m.V(A::LOCKON_POS),float(operator""_Pixels(ConfigFloat("Smash Attack Diameter"))/2.f)}; + float lockOnDistToPlayer=geom2d::line(m.V(A::LOCKON_POS),game->GetPlayer()->GetPos()).length(); + if(geom2d::overlaps(attackCircle,game->GetPlayer()->Hitbox())){ + if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){ + game->GetPlayer()->Knockup(ConfigFloat("Attack Knockup Duration")); + } + } + for(Monster&otherM:MONSTER_LIST){ + if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&& + geom2d::overlaps(attackCircle,otherM.Hitbox())){ + otherM.Knockup(ConfigFloat("Attack Knockup Duration")); + } + } + m.spriteRot=0.f; + game->SetupWorldShake(0.2f); + m.SetStrategyDrawFunction([&](AiL*game){}); + } }break; } } \ No newline at end of file diff --git a/Adventures in Lestoria/Frog.cpp b/Adventures in Lestoria/Frog.cpp index 4ecf33a5..e4c4b865 100644 --- a/Adventures in Lestoria/Frog.cpp +++ b/Adventures in Lestoria/Frog.cpp @@ -58,36 +58,10 @@ void Monster::STRATEGY::FROG(Monster&m,float fElapsedTime,std::string strategy){ m.I(A::PHASE)++; m.F(A::LOCKON_WAITTIME)=ConfigFloat("Lockon Wait Time"); m.V(A::LOCKON_POS)=game->GetPlayer()->GetPos(); - float dirToPlayer=util::angleTo(m.GetPos(),m.V(A::LOCKON_POS)); - #pragma region Face towards lockon direction - if(abs(dirToPlayer)<0.5f*PI){ //This sprite is supposed to be facing right (flipped) - m.facingDirection=RIGHT; - m.spriteRot=dirToPlayer; - }else{ - m.facingDirection=LEFT; - if(dirToPlayer>0){ - m.spriteRot=-PI+dirToPlayer; - }else{ - m.spriteRot=PI+dirToPlayer; - } - } - #pragma endregion + m.RotateTowardsPos(m.V(A::LOCKON_POS)); goto phase; } - float dirToPlayer=util::angleTo(m.GetPos(),m.target); - #pragma region Face towards target direction - if(abs(dirToPlayer)<0.5f*PI){ //This sprite is supposed to be facing right (flipped) - m.facingDirection=RIGHT; - m.spriteRot=dirToPlayer; - }else{ - m.facingDirection=LEFT; - if(dirToPlayer>0){ - m.spriteRot=-PI+dirToPlayer; - }else{ - m.spriteRot=PI+dirToPlayer; - } - } - #pragma endregion + m.RotateTowardsPos(m.target); RUN_TOWARDS(m,fElapsedTime,"Run Towards"); m.PerformJumpAnimation(); }break; diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 74811222..23921870 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -109,9 +109,6 @@ float Monster::GetSizeMult(){ Animate2D::Frame Monster::GetFrame(){ return animation.GetFrame(internal_animState); } -void Monster::UpdateAnimation(std::string state){ - animation.ChangeState(internal_animState,state); -} void Monster::PerformJumpAnimation(){ animation.ChangeState(internal_animState,MONSTER_DATA[name].GetJumpAnimation()); } @@ -121,6 +118,9 @@ void Monster::PerformShootAnimation(){ void Monster::PerformIdleAnimation(){ animation.ChangeState(internal_animState,MONSTER_DATA[name].GetIdleAnimation()); } +void Monster::PerformOtherAnimation(const uint8_t otherInd){ + animation.ChangeState(internal_animState,MONSTER_DATA[name].GetAnimations()[4+otherInd]); +} bool Monster::_SetX(float x,const bool monsterInvoked){ vf2d newPos={x,pos.y}; vi2d tilePos=vi2d(newPos/float(game->GetCurrentMapData().tilewidth))*game->GetCurrentMapData().tilewidth; @@ -380,8 +380,12 @@ void Monster::Moved(){ std::string Monster::GetDeathAnimationName(){ return MONSTER_DATA[name].GetDeathAnimation(); } +const bool Monster::AttackAvoided(const float attackZ)const{ + return HasIframes()||abs(GetZ()-attackZ)>1; +} + bool Monster::Hurt(int damage,bool onUpperLevel,float z){ - if(!IsAlive()||onUpperLevel!=OnUpperLevel()||HasIframes()||abs(GetZ()-z)>1) return false; + if(!IsAlive()||onUpperLevel!=OnUpperLevel()||AttackAvoided(z)) return false; if(game->InBossEncounter()){ game->StartBossEncounter(); } @@ -537,11 +541,11 @@ void Monster::SetState(State::State newState){ state=newState; } -bool Monster::HasIframes(){ +const bool Monster::HasIframes()const{ return iframe_timer>0; } -float Monster::GetZ(){ +const float Monster::GetZ()const{ return z; } @@ -618,4 +622,25 @@ void Monster::Knockup(float duration){ knockUpTimer+=duration; totalKnockupTime+=duration; knockUpZAmt+=32*pow(duration,2); +} + +const std::string&Monster::GetName()const{ + return name; +} + +void Monster::RotateTowardsPos(const vf2d&targetPos){ + float dirToPlayer=util::angleTo(GetPos(),targetPos); + #pragma region Face towards lockon direction + if(abs(dirToPlayer)<0.5f*PI){ //This sprite is supposed to be facing right (flipped) + facingDirection=RIGHT; + spriteRot=dirToPlayer; + }else{ + facingDirection=LEFT; + if(dirToPlayer>0){ + spriteRot=-PI+dirToPlayer; + }else{ + spriteRot=PI+dirToPlayer; + } + } + #pragma endregion } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index 68ece8be..41f0ba3e 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -125,7 +125,6 @@ public: float GetMoveSpdMult(); float GetSizeMult(); Animate2D::Frame GetFrame(); - void UpdateAnimation(std::string state); bool Update(float fElapsedTime); //Returns true when damage is actually dealt. Provide whether or not the attack is on the upper level or not. Monsters must be on the same level to get hit by it. (there is a death check and level check here.) //If you need to hurt multiple enemies try AiL::HurtEnemies() @@ -150,6 +149,7 @@ public: void PerformJumpAnimation(); void PerformShootAnimation(); void PerformIdleAnimation(); + void PerformOtherAnimation(const uint8_t otherInd); bool OnUpperLevel(); void Moved(); //Returns false if a path could not be found. @@ -162,8 +162,8 @@ public: State::State GetState(); void SetState(State::State newState); static void InitializeStrategies(); - bool HasIframes(); - float GetZ(); + const bool HasIframes()const; + const float GetZ()const; void SetZ(float z); const std::function&GetStrategy()const; void SetSize(float newSize,bool immediate=true); @@ -177,6 +177,10 @@ public: void Knockback(const vf2d&vel); //Knockup the player for duration amount of seconds, and Zamt pixels. void Knockup(float duration); + const bool AttackAvoided(const float attackZ)const; + const std::string&GetName()const; + //Rotates this enemy's sprite towards a given location. Also flips it to face the correct direction. + void RotateTowardsPos(const vf2d&targetPos); private: std::string name; vf2d pos; diff --git a/Adventures in Lestoria/MonsterData.cpp b/Adventures in Lestoria/MonsterData.cpp index c1142201..2cdb60f8 100644 --- a/Adventures in Lestoria/MonsterData.cpp +++ b/Adventures in Lestoria/MonsterData.cpp @@ -86,6 +86,14 @@ void MonsterData::InitializeMonsterData(){ walkSound=DATA["Monsters"][MonsterName]["Walk Sound"].GetString(); } + auto CreateHorizontalAnimationSequence=[&](Renderable&img,int frameCount,vf2d size,std::string state,int row,AnimationData data={}){ + Animate2D::FrameSequence anim(data.frameDuration,data.style); + for(int i=0;iGetElapsedTime()).GetSourceImage()->Decal(); + Decal*dec=GFX["range_indicator.png"].Decal(); game->view.DrawRotatedDecal(m.GetPos(),dec,0,dec->sprite->Size()/2,vf2d{m.GetSizeMult(),m.GetSizeMult()},RED); }); } @@ -223,7 +224,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat } if(m.GetState()==State::CASTING){ - m.UpdateAnimation("monsters/Slime King - Cast.png"); + m.PerformOtherAnimation(0); if(m.F(A::CASTING_TIMER)==0){ m.SetState(State::NORMAL); m.I(A::JUMP_COUNT)++; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 15c2b56b..963ed36c 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 5799 +#define VERSION_BUILD 5823 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index a58664e6..cc431adb 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -212,6 +212,19 @@ MonsterStrategy } Bear { - + # How close the bear has to get to begin its attack. + Attack Range = 120 + + # How long the bear charges up its attack. + Chargeup Time = 1.3s + + # How large the range of the attack is. + Smash Attack Diameter = 160 + + # How long to wait in animation time before the attack hits. + Attack Animation Wait Time = 0.6s + + # How long the duration of the knockup is. + Attack Knockup Duration = 0.7s } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 0de08163..44e9a7e5 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -32,9 +32,10 @@ Monsters Hurt Sound = Monster Hurt Death Sound = Slime Dead Walk Sound = Slime Walk - - #Additional custom animations go down below. Start with ANIMATION[0]. Order is: - # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. #ANIMATION[0] = 6, 0.1, Repeat } Blue Slime @@ -68,9 +69,11 @@ Monsters DROP[0] = Blue Slime Remains,65%,1,2 DROP[1] = Minor Health Potion,5%,1,1 DROP[2] = Berries,5%,1,1 - - #Additional custom animations go down below. Start with ANIMATION[0] - #ANIMATION[0] = MY_NEW_ANIMATION + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. + #ANIMATION[0] = 6, 0.1, Repeat } Red Slime { @@ -103,9 +106,11 @@ Monsters DROP[0] = Red Slime Remains,65%,1,2 DROP[1] = Minor Health Potion,5%,1,1 DROP[2] = Berries,5%,1,1 - - #Additional custom animations go down below. Start with ANIMATION[0] - #ANIMATION[0] = MY_NEW_ANIMATION + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. + #ANIMATION[0] = 6, 0.1, Repeat } Yellow Slime { @@ -136,9 +141,11 @@ Monsters # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity DROP[0] = Berries,5%,1,1 - - #Additional custom animations go down below. Start with ANIMATION[0] - #ANIMATION[0] = MY_NEW_ANIMATION + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. + #ANIMATION[0] = 6, 0.1, Repeat } Flower Turret { @@ -171,9 +178,11 @@ Monsters DROP[0] = Bandages,30%,1,1 DROP[1] = Berries,5%,1,1 DROP[2] = Flower Petals,10%,1,1 - - #Additional custom animations go down below. Start with ANIMATION[0] - #ANIMATION[0] = MY_NEW_ANIMATION + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. + #ANIMATION[0] = 6, 0.1, Repeat } Slime King { @@ -206,8 +215,10 @@ Monsters # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity DROP[0] = Berries,5%,1,1 - #Additional custom animations go down below. Start with ANIMATION[0] - ANIMATION[0] = monsters/Slime King - Cast.png + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. + ANIMATION[0] = 10, 0.04, Repeat } Wolf { @@ -238,9 +249,10 @@ Monsters Hurt Sound = Monster Hurt Death Sound = Slime Dead Walk Sound = Slime Walk - - #Additional custom animations go down below. Start with ANIMATION[0]. Order is: - # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. #ANIMATION[0] = 6, 0.1, Repeat } Frog @@ -272,9 +284,10 @@ Monsters Hurt Sound = Monster Hurt Death Sound = Slime Dead Walk Sound = Slime Walk - - #Additional custom animations go down below. Start with ANIMATION[0]. Order is: - # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. #ANIMATION[0] = 6, 0.1, Repeat } Bear @@ -282,14 +295,14 @@ Monsters Health = 210 Attack = 45 - CollisionDmg = 10 + CollisionDmg = 5 MoveSpd = 60% Size = 200% XP = 27 - Strategy = Run Towards + Strategy = Bear #Size of each animation frame SheetFrameSize = 24,24 @@ -301,14 +314,16 @@ Monsters DeathAnimation = 4, 0.15, OneShot # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity - DROP[0] = Frog Skin,35%,1,2 + DROP[0] = Bear Blood,35%,1,2 + DROP[1] = Bear Claw,40%,1,2 Hurt Sound = Monster Hurt Death Sound = Slime Dead Walk Sound = Slime Walk - - #Additional custom animations go down below. Start with ANIMATION[0]. Order is: - # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + + #Additional custom animations go down below. Start with ANIMATION[0] Order is: + # File name, Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) + # NOTE: ANIMATION[0] will always be row 5 of an animation sheet, all numbers that follow are each below each other. ANIMATION[0] = 4, 0.2, OneShot } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/audio/events.txt b/Adventures in Lestoria/assets/config/audio/events.txt index f683bfaf..973e253c 100644 --- a/Adventures in Lestoria/assets/config/audio/events.txt +++ b/Adventures in Lestoria/assets/config/audio/events.txt @@ -7,6 +7,11 @@ Events SFX { + Bear Slam Attack + { + # Specify file names, followed by volume % + File[0] = bear_slam.ogg, 70% + } Consume Potion { # Specify file names, followed by volume % diff --git a/Adventures in Lestoria/assets/config/gfx/gfx.txt b/Adventures in Lestoria/assets/config/gfx/gfx.txt index 6e64e44e..a02ca7c9 100644 --- a/Adventures in Lestoria/assets/config/gfx/gfx.txt +++ b/Adventures in Lestoria/assets/config/gfx/gfx.txt @@ -35,7 +35,6 @@ Images GFX_Splash_Effect = splash_effect.png GFX_Warrior_Sheet = nico-warrior.png GFX_Wizard_Sheet = nico-wizard.png - GFX_SlimeKing_Cast = monsters/Slime King - Cast.png GFX_SkillOverlayIcon = skill_overlay_icon.png GFX_SkillOverlayIconOverlay = skill_overlay_icon_overlay.png GFX_FinishRing = finishring.png diff --git a/Adventures in Lestoria/assets/monsters/Bear.png b/Adventures in Lestoria/assets/monsters/Bear.png index c8fb1ecf..e0670a89 100644 Binary files a/Adventures in Lestoria/assets/monsters/Bear.png and b/Adventures in Lestoria/assets/monsters/Bear.png differ diff --git a/Adventures in Lestoria/assets/monsters/Slime King - Cast.png b/Adventures in Lestoria/assets/monsters/Slime King - Cast.png deleted file mode 100644 index 1e29014f..00000000 Binary files a/Adventures in Lestoria/assets/monsters/Slime King - Cast.png and /dev/null differ diff --git a/Adventures in Lestoria/assets/monsters/Slime King.png b/Adventures in Lestoria/assets/monsters/Slime King.png index fbb09d55..6350c99a 100644 Binary files a/Adventures in Lestoria/assets/monsters/Slime King.png and b/Adventures in Lestoria/assets/monsters/Slime King.png differ diff --git a/Adventures in Lestoria/assets/sounds/bear_slam.ogg b/Adventures in Lestoria/assets/sounds/bear_slam.ogg new file mode 100644 index 00000000..36546136 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/bear_slam.ogg differ diff --git a/Adventures in Lestoria/util.cpp b/Adventures in Lestoria/util.cpp index 5a616df7..9cd4dad9 100644 --- a/Adventures in Lestoria/util.cpp +++ b/Adventures in Lestoria/util.cpp @@ -138,4 +138,8 @@ std::u32string util::WrapText(PixelGameEngine*pge,std::u32string str,int width,F } } return newStr; +} + +long double operator""_Pixels(long double unitDist){ + return unitDist/100*24.; } \ No newline at end of file diff --git a/Adventures in Lestoria/util.h b/Adventures in Lestoria/util.h index aa81a505..4545fee0 100644 --- a/Adventures in Lestoria/util.h +++ b/Adventures in Lestoria/util.h @@ -56,4 +56,7 @@ namespace olc::util{ std::string timerStr(float time); std::string WrapText(PixelGameEngine*pge,std::string str,int width,bool proportional,vd2d scale); std::u32string WrapText(PixelGameEngine*pge,std::u32string str,int width,Font&font,vd2d scale); -} \ No newline at end of file +} + +//Converts unit distances to pixels. (Every 100 units = 24 pixels) +long double operator""_Pixels(long double unitDist); \ No newline at end of file diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 28b9d407..cfccacce 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ