diff --git a/Crawler/AttributableStat.cpp b/Crawler/AttributableStat.cpp index b97757b5..de976848 100644 --- a/Crawler/AttributableStat.cpp +++ b/Crawler/AttributableStat.cpp @@ -67,7 +67,7 @@ void ItemAttribute::Initialize(){ if(DATA["Stats"][key].HasProperty("Modifies")){ modifies=DATA["Stats"][key]["Modifies"].GetString(); } - attributes.insert(key,ItemAttribute(key,DATA["Stats"][key]["Percentage"].GetBool(),modifies)); + attributes.insert(key,ItemAttribute(DATA["Stats"][key]["Display Name"].GetString(),DATA["Stats"][key]["Percentage"].GetBool(),modifies)); } attributes.SetInitialized(); } diff --git a/Crawler/CharacterMenuWindow.cpp b/Crawler/CharacterMenuWindow.cpp index 77b1dc0a..150a2e33 100644 --- a/Crawler/CharacterMenuWindow.cpp +++ b/Crawler/CharacterMenuWindow.cpp @@ -242,7 +242,7 @@ void Menu::InitializeCharacterMenuWindow(){ int yOffset=0; for(const std::string&attribute:displayAttrs){ std::string attrStr=GetLabelText(ItemAttribute::Get(attribute)); - auto attrLabel=characterMenuWindow->ADD("Attribute "+attribute+" Label",StatLabel)({{245,28+2+float(yOffset)},{62,18}},ItemAttribute::Get(attribute),1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; + auto attrLabel=characterMenuWindow->ADD("Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label",StatLabel)({{245,28+2+float(yOffset)},{62,18}},ItemAttribute::Get(attribute),1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; Menu::AddEquipStatListener(attrLabel); yOffset+=20; } diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index 66f7cc6b..111266df 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -209,6 +209,7 @@ bool Crawler::OnUserCreate(){ Inventory::AddItem("Leather Pants"); Inventory::AddItem("Leather Gloves"); Inventory::AddItem("Leather Shoes"); + Inventory::AddItem("Wooden Sword"); LoadLevel(LEVEL_NAMES["starting_map"_S]); ChangePlayerClass(WARRIOR); @@ -1246,7 +1247,7 @@ void Crawler::RenderHud(){ DrawShadowStringPropDecal(vf2d{ScreenWidth()/2+90.f,ScreenHeight()-80.f}-vf2d{float(GetTextSizeProp(castTimeDisplay.str()).x),0},castTimeDisplay.str(),WHITE,BLACK); DrawShadowStringPropDecal(vf2d{ScreenWidth()/2.f-GetTextSizeProp(castText).x*2/2,ScreenHeight()-64.f},castText,WHITE,BLACK,{2,3},std::numeric_limits::max(),2.f); }; - + if(GetPlayer()->GetCastInfo().castTimer>0){ RenderCastbar(GetPlayer()->GetCastInfo()); }else diff --git a/Crawler/Crawler.vcxproj b/Crawler/Crawler.vcxproj index ce6d0626..3a1cc268 100644 --- a/Crawler/Crawler.vcxproj +++ b/Crawler/Crawler.vcxproj @@ -375,7 +375,6 @@ - @@ -566,6 +565,7 @@ + diff --git a/Crawler/Crawler.vcxproj.filters b/Crawler/Crawler.vcxproj.filters index 6a080a4a..14447839 100644 --- a/Crawler/Crawler.vcxproj.filters +++ b/Crawler/Crawler.vcxproj.filters @@ -201,9 +201,6 @@ Header Files\Interface - - Header Files - Header Files\Interface @@ -734,6 +731,9 @@ Documentation\Mechanics + + Configurations\Items + diff --git a/Crawler/MenuItemButton.h b/Crawler/MenuItemButton.h index b29f8954..7a694e3b 100644 --- a/Crawler/MenuItemButton.h +++ b/Crawler/MenuItemButton.h @@ -43,7 +43,6 @@ All rights reserved. #include "Crawler.h" #include "Item.h" #include "safemap.h" -#include "olcPGEX_Graphics2D.h" #include "drawutil.h" INCLUDE_game diff --git a/Crawler/MenuItemItemButton.h b/Crawler/MenuItemItemButton.h index 0aa96d90..e51598a1 100644 --- a/Crawler/MenuItemItemButton.h +++ b/Crawler/MenuItemItemButton.h @@ -43,7 +43,6 @@ All rights reserved. #include "Crawler.h" #include "Item.h" #include "safemap.h" -#include "olcPGEX_Graphics2D.h" INCLUDE_game INCLUDE_ITEM_DATA diff --git a/Crawler/Monster.cpp b/Crawler/Monster.cpp index e4bdde6a..9d86e091 100644 --- a/Crawler/Monster.cpp +++ b/Crawler/Monster.cpp @@ -290,7 +290,7 @@ bool Monster::Hurt(int damage,bool onUpperLevel,float z){ #pragma region Handle Crits bool crit=false; if(util::random(1)GetPlayer()->GetCritRatePct()){ - mod_dmg*=game->GetPlayer()->GetCritDmgPct(); + mod_dmg*=1+game->GetPlayer()->GetCritDmgPct(); crit=true; } #pragma endregion diff --git a/Crawler/Version.h b/Crawler/Version.h index 18cfe999..b24320e5 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 4857 +#define VERSION_BUILD 4867 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Crawler/assets/backgrounds/cave.png b/Crawler/assets/backgrounds/cave.png index 2234ffa6..2c218fe9 100644 Binary files a/Crawler/assets/backgrounds/cave.png and b/Crawler/assets/backgrounds/cave.png differ diff --git a/Crawler/assets/config/Player.txt b/Crawler/assets/config/Player.txt index 70bf550a..8948825b 100644 --- a/Crawler/assets/config/Player.txt +++ b/Crawler/assets/config/Player.txt @@ -7,7 +7,7 @@ Player Crit Rate = 0% # Starting base crit dmg. - Crit Dmg = 150% + Crit Dmg = 50% Starting Money = 100 diff --git a/Crawler/assets/config/items/Equipment.txt b/Crawler/assets/config/items/Equipment.txt index d6b34f7b..edc104ae 100644 --- a/Crawler/assets/config/items/Equipment.txt +++ b/Crawler/assets/config/items/Equipment.txt @@ -2,7 +2,6 @@ Equipment { Leather Helmet { - DisplayName = Leather Helmet Slot = Helmet PartofSet = Leather ItemCategory = Equipment @@ -24,7 +23,6 @@ Equipment } Leather Armor { - DisplayName = Leather Armor Slot = Armor PartofSet = Leather ItemCategory = Equipment @@ -46,7 +44,6 @@ Equipment } Leather Pants { - DisplayName = Leather Pants Slot = Pants PartofSet = Leather ItemCategory = Equipment @@ -68,7 +65,6 @@ Equipment } Leather Gloves { - DisplayName = Leather Gloves Slot = Gloves PartofSet = Leather ItemCategory = Equipment @@ -90,7 +86,6 @@ Equipment } Leather Shoes { - DisplayName = Leather Shoes Slot = Shoes PartofSet = Leather ItemCategory = Equipment @@ -112,7 +107,6 @@ Equipment } Copper Helmet { - DisplayName = Copper Helmet Slot = Helmet PartofSet = Copper ItemCategory = Equipment @@ -134,7 +128,6 @@ Equipment } Copper Armor { - DisplayName = Copper Armor Slot = Armor PartofSet = Copper ItemCategory = Equipment @@ -156,7 +149,6 @@ Equipment } Copper Pants { - DisplayName = Copper Pants Slot = Pants PartofSet = Copper ItemCategory = Equipment @@ -178,7 +170,6 @@ Equipment } Copper Gloves { - DisplayName = Copper Gloves Slot = Gloves PartofSet = Copper ItemCategory = Equipment @@ -200,7 +191,6 @@ Equipment } Copper Shoes { - DisplayName = Copper Shoes Slot = Shoes PartofSet = Copper ItemCategory = Equipment @@ -222,7 +212,6 @@ Equipment } Shell Helmet { - DisplayName = Shell Helmet Slot = Helmet PartofSet = Shell ItemCategory = Equipment @@ -244,7 +233,6 @@ Equipment } Shell Armor { - DisplayName = Shell Armor Slot = Armor PartofSet = Shell ItemCategory = Equipment @@ -266,7 +254,6 @@ Equipment } Shell Pants { - DisplayName = Shell Pants Slot = Pants PartofSet = Shell ItemCategory = Equipment @@ -288,7 +275,6 @@ Equipment } Shell Gloves { - DisplayName = Shell Gloves Slot = Gloves PartofSet = Shell ItemCategory = Equipment @@ -310,7 +296,6 @@ Equipment } Shell Shoes { - DisplayName = Shell Shoes Slot = Shoes PartofSet = Shell ItemCategory = Equipment @@ -332,7 +317,6 @@ Equipment } Bone Helmet { - DisplayName = Bone Helmet Slot = Helmet PartofSet = Bone ItemCategory = Equipment @@ -354,7 +338,6 @@ Equipment } Bone Armor { - DisplayName = Bone Armor Slot = Armor PartofSet = Bone ItemCategory = Equipment @@ -376,7 +359,6 @@ Equipment } Bone Pants { - DisplayName = Bone Pants Slot = Pants PartofSet = Bone ItemCategory = Equipment @@ -399,7 +381,6 @@ Equipment } Bone Gloves { - DisplayName = Bone Gloves Slot = Gloves PartofSet = Bone ItemCategory = Equipment @@ -421,7 +402,6 @@ Equipment } Bone Shoes { - DisplayName = Bone Shoes Slot = Shoes PartofSet = Bone ItemCategory = Equipment @@ -441,5 +421,4 @@ Equipment StatValues[9] = 19,11,11 StatValues[10] = 21,12,12 } - } \ No newline at end of file diff --git a/Crawler/assets/config/items/ItemScript.txt b/Crawler/assets/config/items/ItemScript.txt index bc2ec52e..7508503e 100644 --- a/Crawler/assets/config/items/ItemScript.txt +++ b/Crawler/assets/config/items/ItemScript.txt @@ -34,6 +34,8 @@ ItemScript HP6 Recovery % = 0%,0.0 HP4 Recovery % = 0%,0.0 Damage Reduction = 0%,0.0 + Attack Spd = 0,0.0 + Mana = 0,0.0 } # Unlike an item or ability that requires a cast to perform, this applies a buff immediately and then moving cancels the buff mid-application. diff --git a/Crawler/assets/config/items/ItemStats.txt b/Crawler/assets/config/items/ItemStats.txt index dbcc3a3c..0f0db8c5 100644 --- a/Crawler/assets/config/items/ItemStats.txt +++ b/Crawler/assets/config/items/ItemStats.txt @@ -2,61 +2,85 @@ Stats { Defense { + Display Name = Defense Percentage = False } Health { + Display Name = Health Percentage = False } Attack { + Display Name = Attack Percentage = False } Defense % { + Display Name = Defense Modifies = Defense Percentage = True } Attack % { + Display Name = Attack Modifies = Attack Percentage = True } Health % { + Display Name = Health Modifies = Health Percentage = True } Move Spd % { + Display Name = Move Spd Percentage = True } CDR { + Display Name = CDR Percentage = True } Crit Rate { + Display Name = Crit Rate Percentage = True } Crit Dmg { + Display Name = Crit Dmg Percentage = True } HP Recovery % { + Display Name = HP Recovery Percentage = True } HP6 Recovery % { + Display Name = HP/6 Recovery Percentage = True } HP4 Recovery % { + Display Name = HP/4 Recovery Percentage = True } Damage Reduction { + Display Name = Damage Reduction Percentage = True } + Attack Spd + { + Display Name = Attack Spd + Percentage = False + } + Mana + { + Display Name = Mana + Percentage = False + } } \ No newline at end of file diff --git a/Crawler/assets/config/items/Weapons.txt b/Crawler/assets/config/items/Weapons.txt new file mode 100644 index 00000000..6da0d20d --- /dev/null +++ b/Crawler/assets/config/items/Weapons.txt @@ -0,0 +1,306 @@ +Equipment +{ + Wooden Sword + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,Move Spd % + StatValues[0] = 5,5,0 + StatValues[1] = 10,6,1 + StatValues[2] = 15,7,2 + StatValues[3] = 20,8,3 + StatValues[4] = 25,9,4 + StatValues[5] = 30,10,5 + StatValues[6] = 80,11,6 + StatValues[7] = 115,12,7 + StatValues[8] = 150,13,8 + StatValues[9] = 160,14,9 + StatValues[10] = 170,15,10 + } + Wooden Bow + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,Move Spd % + StatValues[0] = 5,5,0 + StatValues[1] = 10,6,1 + StatValues[2] = 15,7,2 + StatValues[3] = 20,8,3 + StatValues[4] = 25,9,4 + StatValues[5] = 30,10,5 + StatValues[6] = 80,11,6 + StatValues[7] = 115,12,7 + StatValues[8] = 150,13,8 + StatValues[9] = 160,14,9 + StatValues[10] = 170,15,10 + } + Wooden Staff + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,Move Spd % + StatValues[0] = 5,5,0 + StatValues[1] = 10,6,1 + StatValues[2] = 15,7,2 + StatValues[3] = 20,8,3 + StatValues[4] = 25,9,4 + StatValues[5] = 30,10,5 + StatValues[6] = 80,11,6 + StatValues[7] = 115,12,7 + StatValues[8] = 150,13,8 + StatValues[9] = 160,14,9 + StatValues[10] = 170,15,10 + } + Steel Sword + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,Defense + StatValues[0] = 26,5,5 + StatValues[1] = 31,6,10 + StatValues[2] = 36,7,20 + StatValues[3] = 41,8,30 + StatValues[4] = 46,9,40 + StatValues[5] = 51,10,50 + StatValues[6] = 90,11,60 + StatValues[7] = 120,12,70 + StatValues[8] = 150,13,80 + StatValues[9] = 160,14,90 + StatValues[10] = 170,15,100 + } + Steel Bow + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,Defense + StatValues[0] = 26,5,5 + StatValues[1] = 31,6,10 + StatValues[2] = 36,7,20 + StatValues[3] = 41,8,30 + StatValues[4] = 46,9,40 + StatValues[5] = 51,10,50 + StatValues[6] = 90,11,60 + StatValues[7] = 120,12,70 + StatValues[8] = 150,13,80 + StatValues[9] = 160,14,90 + StatValues[10] = 170,15,100 + } + Steel Staff + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,Defense + StatValues[0] = 26,5,5 + StatValues[1] = 31,6,10 + StatValues[2] = 36,7,20 + StatValues[3] = 41,8,30 + StatValues[4] = 46,9,40 + StatValues[5] = 51,10,50 + StatValues[6] = 90,11,60 + StatValues[7] = 120,12,70 + StatValues[8] = 150,13,80 + StatValues[9] = 160,14,90 + StatValues[10] = 170,15,100 + } + Shell Sword + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,CDR,Mana + StatValues[0] = 47,5,0,0 + StatValues[1] = 52,6,2,1 + StatValues[2] = 57,7,4,2 + StatValues[3] = 62,8,6,3 + StatValues[4] = 67,9,8,4 + StatValues[5] = 72,10,10,5 + StatValues[6] = 100,11,12,6 + StatValues[7] = 125,12,14,7 + StatValues[8] = 150,13,16,8 + StatValues[9] = 160,14,18,9 + StatValues[10] = 170,15,20,10 + } + Shell Bow + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,CDR,Mana + StatValues[0] = 47,5,0,0 + StatValues[1] = 52,6,2,1 + StatValues[2] = 57,7,4,2 + StatValues[3] = 62,8,6,3 + StatValues[4] = 67,9,8,4 + StatValues[5] = 72,10,10,5 + StatValues[6] = 100,11,12,6 + StatValues[7] = 125,12,14,7 + StatValues[8] = 150,13,16,8 + StatValues[9] = 160,14,18,9 + StatValues[10] = 170,15,20,10 + } + Shell Staff + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate,CDR,Mana + StatValues[0] = 47,5,0,0 + StatValues[1] = 52,6,2,1 + StatValues[2] = 57,7,4,2 + StatValues[3] = 62,8,6,3 + StatValues[4] = 67,9,8,4 + StatValues[5] = 72,10,10,5 + StatValues[6] = 100,11,12,6 + StatValues[7] = 125,12,14,7 + StatValues[8] = 150,13,16,8 + StatValues[9] = 160,14,18,9 + StatValues[10] = 170,15,20,10 + } + Bone Sword + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate + StatValues[0] = 68,10 + StatValues[1] = 73,12 + StatValues[2] = 78,14 + StatValues[3] = 83,16 + StatValues[4] = 88,18 + StatValues[5] = 93,20 + StatValues[6] = 110,22 + StatValues[7] = 125,24 + StatValues[8] = 150,26 + StatValues[9] = 160,28 + StatValues[10] = 170,30 + } + Bone Bow + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate + StatValues[0] = 68,10 + StatValues[1] = 73,12 + StatValues[2] = 78,14 + StatValues[3] = 83,16 + StatValues[4] = 88,18 + StatValues[5] = 93,20 + StatValues[6] = 110,22 + StatValues[7] = 125,24 + StatValues[8] = 150,26 + StatValues[9] = 160,28 + StatValues[10] = 170,30 + } + Bone Staff + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + StatValues = Attack,Crit Rate + StatValues[0] = 68,10 + StatValues[1] = 73,12 + StatValues[2] = 78,14 + StatValues[3] = 83,16 + StatValues[4] = 88,18 + StatValues[5] = 93,20 + StatValues[6] = 110,22 + StatValues[7] = 125,24 + StatValues[8] = 150,26 + StatValues[9] = 160,28 + StatValues[10] = 170,30 + } + Laser Sword + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + # Attack Speed Increase reduces Cooldown of LeftClick Attacks (0.1 sec in this case) + StatValues = Attack,Crit Rate,Attack Spd + StatValues[0] = 89,5,0.1 + StatValues[1] = 95,6,0.1 + StatValues[2] = 101,7,0.1 + StatValues[3] = 107,8,0.1 + StatValues[4] = 113,9,0.1 + StatValues[5] = 119,10,0.1 + StatValues[6] = 130,11,0.1 + StatValues[7] = 140,12,0.1 + StatValues[8] = 150,13,0.1 + StatValues[9] = 160,14,0.1 + StatValues[10] = 170,15,0.1 + } + Plasma Bow + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + # Attack Speed Increase reduces Cooldown of LeftClick Attacks (0.1 sec in this case) + StatValues = Attack,Crit Rate,Attack Spd + StatValues[0] = 89,5,0.1 + StatValues[1] = 95,6,0.1 + StatValues[2] = 101,7,0.1 + StatValues[3] = 107,8,0.1 + StatValues[4] = 113,9,0.1 + StatValues[5] = 119,10,0.1 + StatValues[6] = 130,11,0.1 + StatValues[7] = 140,12,0.1 + StatValues[8] = 150,13,0.1 + StatValues[9] = 160,14,0.1 + StatValues[10] = 170,15,0.1 + } + Unknown Staff + { + Slot = Weapon + ItemCategory = Equipment + + # Stat Values of the item based on Enhancement level. + # See ItemSets.txt for valid stat names + # Attack Speed Increase reduces Cooldown of LeftClick Attacks (0.1 sec in this case) + StatValues = Attack,Crit Rate,Attack Spd + StatValues[0] = 89,5,0.1 + StatValues[1] = 95,6,0.1 + StatValues[2] = 101,7,0.1 + StatValues[3] = 107,8,0.1 + StatValues[4] = 113,9,0.1 + StatValues[5] = 119,10,0.1 + StatValues[6] = 130,11,0.1 + StatValues[7] = 140,12,0.1 + StatValues[8] = 150,13,0.1 + StatValues[9] = 160,14,0.1 + StatValues[10] = 170,15,0.1 + } +} \ No newline at end of file diff --git a/Crawler/assets/config/items/items.txt b/Crawler/assets/config/items/items.txt index 7982c615..38565686 100644 --- a/Crawler/assets/config/items/items.txt +++ b/Crawler/assets/config/items/items.txt @@ -4,6 +4,7 @@ ItemConfiguration Item Scripts = ItemScript.txt Item Categories = ItemCategory.txt Equipment = Equipment.txt + Weapons = Weapons.txt } Item { diff --git a/Crawler/assets/items/Bone Bow.png b/Crawler/assets/items/Bone Bow.png new file mode 100644 index 00000000..362c6ba0 Binary files /dev/null and b/Crawler/assets/items/Bone Bow.png differ diff --git a/Crawler/assets/items/Bone Staff.png b/Crawler/assets/items/Bone Staff.png new file mode 100644 index 00000000..0d1d313f Binary files /dev/null and b/Crawler/assets/items/Bone Staff.png differ diff --git a/Crawler/assets/items/Bone Sword.png b/Crawler/assets/items/Bone Sword.png new file mode 100644 index 00000000..4de9f2e9 Binary files /dev/null and b/Crawler/assets/items/Bone Sword.png differ diff --git a/Crawler/assets/items/Laser Sword.png b/Crawler/assets/items/Laser Sword.png new file mode 100644 index 00000000..f3af7e2d Binary files /dev/null and b/Crawler/assets/items/Laser Sword.png differ diff --git a/Crawler/assets/items/Plasma Bow.png b/Crawler/assets/items/Plasma Bow.png new file mode 100644 index 00000000..325d9eef Binary files /dev/null and b/Crawler/assets/items/Plasma Bow.png differ diff --git a/Crawler/assets/items/Shell Bow.png b/Crawler/assets/items/Shell Bow.png new file mode 100644 index 00000000..880cfe98 Binary files /dev/null and b/Crawler/assets/items/Shell Bow.png differ diff --git a/Crawler/assets/items/Shell Staff.png b/Crawler/assets/items/Shell Staff.png new file mode 100644 index 00000000..d5e960ac Binary files /dev/null and b/Crawler/assets/items/Shell Staff.png differ diff --git a/Crawler/assets/items/Shell Sword.png b/Crawler/assets/items/Shell Sword.png new file mode 100644 index 00000000..7227208b Binary files /dev/null and b/Crawler/assets/items/Shell Sword.png differ diff --git a/Crawler/assets/items/Steel Bow.png b/Crawler/assets/items/Steel Bow.png new file mode 100644 index 00000000..5d4fb2d3 Binary files /dev/null and b/Crawler/assets/items/Steel Bow.png differ diff --git a/Crawler/assets/items/Steel Staff.png b/Crawler/assets/items/Steel Staff.png new file mode 100644 index 00000000..695d159b Binary files /dev/null and b/Crawler/assets/items/Steel Staff.png differ diff --git a/Crawler/assets/items/Steel Sword.png b/Crawler/assets/items/Steel Sword.png new file mode 100644 index 00000000..35cf37c0 Binary files /dev/null and b/Crawler/assets/items/Steel Sword.png differ diff --git a/Crawler/assets/items/Unknown Staff.png b/Crawler/assets/items/Unknown Staff.png new file mode 100644 index 00000000..82f3c51d Binary files /dev/null and b/Crawler/assets/items/Unknown Staff.png differ diff --git a/Crawler/assets/items/Wooden Bow.png b/Crawler/assets/items/Wooden Bow.png new file mode 100644 index 00000000..0982a4e8 Binary files /dev/null and b/Crawler/assets/items/Wooden Bow.png differ diff --git a/Crawler/assets/items/Wooden Staff.png b/Crawler/assets/items/Wooden Staff.png new file mode 100644 index 00000000..783fae79 Binary files /dev/null and b/Crawler/assets/items/Wooden Staff.png differ diff --git a/Crawler/assets/items/Wooden Sword.png b/Crawler/assets/items/Wooden Sword.png new file mode 100644 index 00000000..997281d3 Binary files /dev/null and b/Crawler/assets/items/Wooden Sword.png differ diff --git a/Crawler/olcPGEX_Graphics2D.h b/Crawler/olcPGEX_Graphics2D.h deleted file mode 100644 index 45d473ef..00000000 --- a/Crawler/olcPGEX_Graphics2D.h +++ /dev/null @@ -1,313 +0,0 @@ -/* - olcPGEX_Graphics2D.h - - +-------------------------------------------------------------+ - | OneLoneCoder Pixel Game Engine Extension | - | Advanced 2D Rendering - v0.5 | - +-------------------------------------------------------------+ - - What is this? - ~~~~~~~~~~~~~ - This is an extension to the olcPixelGameEngine, which provides - advanced olc::Sprite manipulation and drawing routines. To use - it, simply include this header file. - - License (OLC-3) - ~~~~~~~~~~~~~~~ - - Copyright 2018 - 2019 OneLoneCoder.com - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions or derivations of source code must retain the above - copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions or derivative works in binary form must reproduce - the above copyright notice. This list of conditions and the following - disclaimer must be reproduced in the documentation and/or other - materials provided with the distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Links - ~~~~~ - YouTube: https://www.youtube.com/javidx9 - Discord: https://discord.gg/WhwHUMV - Twitter: https://www.twitter.com/javidx9 - Twitch: https://www.twitch.tv/javidx9 - GitHub: https://www.github.com/onelonecoder - Homepage: https://www.onelonecoder.com - - Author - ~~~~~~ - David Barr, aka javidx9, ŠOneLoneCoder 2019 -*/ - -/* - Matrices stored as [Column][Row] (i.e. x, y) - - |C0R0 C1R0 C2R0| | x | | x'| - |C0R1 C1R1 C2R1| * | y | = | y'| - |C0R2 C1R2 C2R2| |1.0| | - | -*/ - - - -#ifndef OLC_PGEX_GFX2D -#define OLC_PGEX_GFX2D - -#include -#undef min -#undef max - -namespace olc -{ - // Container class for Advanced 2D Drawing functions - class GFX2D : public olc::PGEX - { - // A representation of an affine transform, used to rotate, scale, offset & shear space - public: - class Transform2D - { - public: - Transform2D(); - - public: - // Set this transformation to unity - void Reset(); - // Append a rotation of fTheta radians to this transform - void Rotate(float fTheta); - // Append a translation (ox, oy) to this transform - void Translate(float ox, float oy); - // Append a scaling operation (sx, sy) to this transform - void Scale(float sx, float sy); - // Append a shear operation (sx, sy) to this transform - void Shear(float sx, float sy); - - void Perspective(float ox, float oy); - // Calculate the Forward Transformation of the coordinate (in_x, in_y) -> (out_x, out_y) - void Forward(float in_x, float in_y, float &out_x, float &out_y); - // Calculate the Inverse Transformation of the coordinate (in_x, in_y) -> (out_x, out_y) - void Backward(float in_x, float in_y, float &out_x, float &out_y); - // Regenerate the Inverse Transformation - void Invert(); - - private: - void Multiply(); - float matrix[4][3][3]; - int nTargetMatrix; - int nSourceMatrix; - bool bDirty; - }; - - public: - // Draws a sprite with the transform applied - static void DrawSprite(olc::Sprite *sprite, olc::GFX2D::Transform2D &transform); - }; -} - - -#ifdef OLC_PGEX_GRAPHICS2D -#undef OLC_PGEX_GRAPHICS2D - -namespace olc -{ - void GFX2D::DrawSprite(olc::Sprite *sprite, olc::GFX2D::Transform2D &transform) - { - if (sprite == nullptr) - return; - - // Work out bounding rectangle of sprite - float ex, ey; - float sx, sy; - float px, py; - - transform.Forward(0.0f, 0.0f, sx, sy); - px = sx; py = sy; - sx = std::min(sx, px); sy = std::min(sy, py); - ex = std::max(ex, px); ey = std::max(ey, py); - - transform.Forward((float)sprite->width, (float)sprite->height, px, py); - sx = std::min(sx, px); sy = std::min(sy, py); - ex = std::max(ex, px); ey = std::max(ey, py); - - transform.Forward(0.0f, (float)sprite->height, px, py); - sx = std::min(sx, px); sy = std::min(sy, py); - ex = std::max(ex, px); ey = std::max(ey, py); - - transform.Forward((float)sprite->width, 0.0f, px, py); - sx = std::min(sx, px); sy = std::min(sy, py); - ex = std::max(ex, px); ey = std::max(ey, py); - - // Perform inversion of transform if required - transform.Invert(); - - if (ex < sx) - std::swap(ex, sx); - if (ey < sy) - std::swap(ey, sy); - - // Iterate through render space, and sample Sprite from suitable texel location - for (float i = sx; i < ex; i++) - { - for (float j = sy; j < ey; j++) - { - float ox, oy; - transform.Backward(i, j, ox, oy); - pge->Draw((int32_t)i, (int32_t)j, sprite->GetPixel((int32_t)(ox+0.5f), (int32_t)(oy+0.5f))); - } - } - } - - olc::GFX2D::Transform2D::Transform2D() - { - Reset(); - } - - void olc::GFX2D::Transform2D::Reset() - { - nTargetMatrix = 0; - nSourceMatrix = 1; - bDirty = true; - - // Columns Then Rows - - // Matrices 0 & 1 are used as swaps in Transform accumulation - matrix[0][0][0] = 1.0f; matrix[0][1][0] = 0.0f; matrix[0][2][0] = 0.0f; - matrix[0][0][1] = 0.0f; matrix[0][1][1] = 1.0f; matrix[0][2][1] = 0.0f; - matrix[0][0][2] = 0.0f; matrix[0][1][2] = 0.0f; matrix[0][2][2] = 1.0f; - - matrix[1][0][0] = 1.0f; matrix[1][1][0] = 0.0f; matrix[1][2][0] = 0.0f; - matrix[1][0][1] = 0.0f; matrix[1][1][1] = 1.0f; matrix[1][2][1] = 0.0f; - matrix[1][0][2] = 0.0f; matrix[1][1][2] = 0.0f; matrix[1][2][2] = 1.0f; - - // Matrix 2 is a cache matrix to hold the immediate transform operation - // Matrix 3 is a cache matrix to hold the inverted transform - } - - void olc::GFX2D::Transform2D::Multiply() - { - for (int c = 0; c < 3; c++) - { - for (int r = 0; r < 3; r++) - { - matrix[nTargetMatrix][c][r] = matrix[2][0][r] * matrix[nSourceMatrix][c][0] + - matrix[2][1][r] * matrix[nSourceMatrix][c][1] + - matrix[2][2][r] * matrix[nSourceMatrix][c][2]; - } - } - - std::swap(nTargetMatrix, nSourceMatrix); - bDirty = true; // Any transform multiply dirties the inversion - } - - void olc::GFX2D::Transform2D::Rotate(float fTheta) - { - // Construct Rotation Matrix - matrix[2][0][0] = cosf(fTheta); matrix[2][1][0] = sinf(fTheta); matrix[2][2][0] = 0.0f; - matrix[2][0][1] = -sinf(fTheta); matrix[2][1][1] = cosf(fTheta); matrix[2][2][1] = 0.0f; - matrix[2][0][2] = 0.0f; matrix[2][1][2] = 0.0f; matrix[2][2][2] = 1.0f; - Multiply(); - } - - void olc::GFX2D::Transform2D::Scale(float sx, float sy) - { - // Construct Scale Matrix - matrix[2][0][0] = sx; matrix[2][1][0] = 0.0f; matrix[2][2][0] = 0.0f; - matrix[2][0][1] = 0.0f; matrix[2][1][1] = sy; matrix[2][2][1] = 0.0f; - matrix[2][0][2] = 0.0f; matrix[2][1][2] = 0.0f; matrix[2][2][2] = 1.0f; - Multiply(); - } - - void olc::GFX2D::Transform2D::Shear(float sx, float sy) - { - // Construct Shear Matrix - matrix[2][0][0] = 1.0f; matrix[2][1][0] = sx; matrix[2][2][0] = 0.0f; - matrix[2][0][1] = sy; matrix[2][1][1] = 1.0f; matrix[2][2][1] = 0.0f; - matrix[2][0][2] = 0.0f; matrix[2][1][2] = 0.0f; matrix[2][2][2] = 1.0f; - Multiply(); - } - - void olc::GFX2D::Transform2D::Translate(float ox, float oy) - { - // Construct Translate Matrix - matrix[2][0][0] = 1.0f; matrix[2][1][0] = 0.0f; matrix[2][2][0] = ox; - matrix[2][0][1] = 0.0f; matrix[2][1][1] = 1.0f; matrix[2][2][1] = oy; - matrix[2][0][2] = 0.0f; matrix[2][1][2] = 0.0f; matrix[2][2][2] = 1.0f; - Multiply(); - } - - void olc::GFX2D::Transform2D::Perspective(float ox, float oy) - { - // Construct Translate Matrix - matrix[2][0][0] = 1.0f; matrix[2][1][0] = 0.0f; matrix[2][2][0] = 0.0f; - matrix[2][0][1] = 0.0f; matrix[2][1][1] = 1.0f; matrix[2][2][1] = 0.0f; - matrix[2][0][2] = ox; matrix[2][1][2] = oy; matrix[2][2][2] = 1.0f; - Multiply(); - } - - void olc::GFX2D::Transform2D::Forward(float in_x, float in_y, float &out_x, float &out_y) - { - out_x = in_x * matrix[nSourceMatrix][0][0] + in_y * matrix[nSourceMatrix][1][0] + matrix[nSourceMatrix][2][0]; - out_y = in_x * matrix[nSourceMatrix][0][1] + in_y * matrix[nSourceMatrix][1][1] + matrix[nSourceMatrix][2][1]; - float out_z = in_x * matrix[nSourceMatrix][0][2] + in_y * matrix[nSourceMatrix][1][2] + matrix[nSourceMatrix][2][2]; - if (out_z != 0) - { - out_x /= out_z; - out_y /= out_z; - } - } - - void olc::GFX2D::Transform2D::Backward(float in_x, float in_y, float &out_x, float &out_y) - { - out_x = in_x * matrix[3][0][0] + in_y * matrix[3][1][0] + matrix[3][2][0]; - out_y = in_x * matrix[3][0][1] + in_y * matrix[3][1][1] + matrix[3][2][1]; - float out_z = in_x * matrix[3][0][2] + in_y * matrix[3][1][2] + matrix[3][2][2]; - if (out_z != 0) - { - out_x /= out_z; - out_y /= out_z; - } - } - - void olc::GFX2D::Transform2D::Invert() - { - if (bDirty) // Obviously costly so only do if needed - { - float det = matrix[nSourceMatrix][0][0] * (matrix[nSourceMatrix][1][1] * matrix[nSourceMatrix][2][2] - matrix[nSourceMatrix][1][2] * matrix[nSourceMatrix][2][1]) - - matrix[nSourceMatrix][1][0] * (matrix[nSourceMatrix][0][1] * matrix[nSourceMatrix][2][2] - matrix[nSourceMatrix][2][1] * matrix[nSourceMatrix][0][2]) + - matrix[nSourceMatrix][2][0] * (matrix[nSourceMatrix][0][1] * matrix[nSourceMatrix][1][2] - matrix[nSourceMatrix][1][1] * matrix[nSourceMatrix][0][2]); - - float idet = 1.0f / det; - matrix[3][0][0] = (matrix[nSourceMatrix][1][1] * matrix[nSourceMatrix][2][2] - matrix[nSourceMatrix][1][2] * matrix[nSourceMatrix][2][1]) * idet; - matrix[3][1][0] = (matrix[nSourceMatrix][2][0] * matrix[nSourceMatrix][1][2] - matrix[nSourceMatrix][1][0] * matrix[nSourceMatrix][2][2]) * idet; - matrix[3][2][0] = (matrix[nSourceMatrix][1][0] * matrix[nSourceMatrix][2][1] - matrix[nSourceMatrix][2][0] * matrix[nSourceMatrix][1][1]) * idet; - matrix[3][0][1] = (matrix[nSourceMatrix][2][1] * matrix[nSourceMatrix][0][2] - matrix[nSourceMatrix][0][1] * matrix[nSourceMatrix][2][2]) * idet; - matrix[3][1][1] = (matrix[nSourceMatrix][0][0] * matrix[nSourceMatrix][2][2] - matrix[nSourceMatrix][2][0] * matrix[nSourceMatrix][0][2]) * idet; - matrix[3][2][1] = (matrix[nSourceMatrix][0][1] * matrix[nSourceMatrix][2][0] - matrix[nSourceMatrix][0][0] * matrix[nSourceMatrix][2][1]) * idet; - matrix[3][0][2] = (matrix[nSourceMatrix][0][1] * matrix[nSourceMatrix][1][2] - matrix[nSourceMatrix][0][2] * matrix[nSourceMatrix][1][1]) * idet; - matrix[3][1][2] = (matrix[nSourceMatrix][0][2] * matrix[nSourceMatrix][1][0] - matrix[nSourceMatrix][0][0] * matrix[nSourceMatrix][1][2]) * idet; - matrix[3][2][2] = (matrix[nSourceMatrix][0][0] * matrix[nSourceMatrix][1][1] - matrix[nSourceMatrix][0][1] * matrix[nSourceMatrix][1][0]) * idet; - bDirty = false; - } - } -} - -#endif -#endif \ No newline at end of file diff --git a/Crawler/olcPGEX_ViewPort.h b/Crawler/olcPGEX_ViewPort.h index a54b9771..65f99d60 100644 --- a/Crawler/olcPGEX_ViewPort.h +++ b/Crawler/olcPGEX_ViewPort.h @@ -736,15 +736,15 @@ void olc::ViewPort::DrawShadowStringDecal(const olc::vf2d& pos, std::string_view pge->Clear(BLANK); pge->DrawString({0,0},sText,WHITE,1U,width/scale.x); newDecal->Update(); - float adjustedShadowSizeFactor=shadowSizeFactor*4/std::max(scale.x,scale.y); - Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor*2)); + vf2d adjustedShadowSizeFactor=vf2d{shadowSizeFactor,shadowSizeFactor}*4/scale; + Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor.x*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor.y*2)); garbageCollector[key+"_SHADOW"].decal=newShadowDecal; pge->SetDrawTarget(newShadowDecal->sprite); pge->Clear(BLANK); - for(float y=-adjustedShadowSizeFactor;y<=adjustedShadowSizeFactor+0.1;y+=adjustedShadowSizeFactor/2){ - for(float x=-adjustedShadowSizeFactor;x<=adjustedShadowSizeFactor+0.1;x+=adjustedShadowSizeFactor/2){ + for(float y=-adjustedShadowSizeFactor.y;y<=adjustedShadowSizeFactor.y+0.1;y+=adjustedShadowSizeFactor.y/2){ + for(float x=-adjustedShadowSizeFactor.x;x<=adjustedShadowSizeFactor.x+0.1;x+=adjustedShadowSizeFactor.x/2){ if(x!=0||y!=0){ - pge->DrawString(vf2d{x,y}+vf2d{adjustedShadowSizeFactor,adjustedShadowSizeFactor}, sText, WHITE,4U,width/scale.x*4); + pge->DrawString(vf2d{x,y}+adjustedShadowSizeFactor, sText, WHITE,4U,width/scale.x*4); } } } @@ -784,15 +784,15 @@ void olc::ViewPort::DrawShadowStringPropDecal(const olc::vf2d& pos, std::string_ pge->Clear(BLANK); pge->DrawStringProp({0,0},sText,WHITE,1U,width/scale.x); newDecal->Update(); - float adjustedShadowSizeFactor=shadowSizeFactor*4/std::max(scale.x,scale.y); - Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor*2)); + vf2d adjustedShadowSizeFactor=vf2d{shadowSizeFactor,shadowSizeFactor}*4/scale; + Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor.x*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor.y*2)); garbageCollector[key+"_SHADOW"].decal=newShadowDecal; pge->SetDrawTarget(newShadowDecal->sprite); pge->Clear(BLANK); - for(float y=-adjustedShadowSizeFactor;y<=adjustedShadowSizeFactor+0.1;y+=adjustedShadowSizeFactor/2){ - for(float x=-adjustedShadowSizeFactor;x<=adjustedShadowSizeFactor+0.1;x+=adjustedShadowSizeFactor/2){ + for(float y=-adjustedShadowSizeFactor.y;y<=adjustedShadowSizeFactor.y+0.1;y+=adjustedShadowSizeFactor.y/2){ + for(float x=-adjustedShadowSizeFactor.x;x<=adjustedShadowSizeFactor.x+0.1;x+=adjustedShadowSizeFactor.x/2){ if(x!=0||y!=0){ - pge->DrawStringProp(vf2d{x,y}+vf2d{adjustedShadowSizeFactor,adjustedShadowSizeFactor}, sText, WHITE,4U,width/scale.x*4); + pge->DrawStringProp(vf2d{x,y}+adjustedShadowSizeFactor, sText, WHITE,4U,width/scale.x*4); } } } diff --git a/Crawler/olcPixelGameEngine.h b/Crawler/olcPixelGameEngine.h index 33e019d2..e9805680 100644 --- a/Crawler/olcPixelGameEngine.h +++ b/Crawler/olcPixelGameEngine.h @@ -3440,15 +3440,15 @@ namespace olc Clear(BLANK); DrawString({0,0},sText,WHITE,1U,width/scale.x); newDecal->Update(); - float adjustedShadowSizeFactor=shadowSizeFactor*4/std::max(scale.x,scale.y); - Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor*2)); + vf2d adjustedShadowSizeFactor=vf2d{shadowSizeFactor,shadowSizeFactor}*4/scale; + Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor.x*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor.y*2)); garbageCollector[key+"_SHADOW"].decal=newShadowDecal; SetDrawTarget(newShadowDecal->sprite); Clear(BLANK); - for(float y=-adjustedShadowSizeFactor;y<=adjustedShadowSizeFactor+0.1;y+=adjustedShadowSizeFactor/2){ - for(float x=-adjustedShadowSizeFactor;x<=adjustedShadowSizeFactor+0.1;x+=adjustedShadowSizeFactor/2){ + for(float y=-adjustedShadowSizeFactor.y;y<=adjustedShadowSizeFactor.y+0.1;y+=adjustedShadowSizeFactor.y/2){ + for(float x=-adjustedShadowSizeFactor.x;x<=adjustedShadowSizeFactor.x+0.1;x+=adjustedShadowSizeFactor.x/2){ if(x!=0||y!=0){ - DrawString(vf2d{x,y}+vf2d{adjustedShadowSizeFactor,adjustedShadowSizeFactor}, sText, WHITE,4U,width/scale.x*4); + DrawString(vf2d{x,y}+adjustedShadowSizeFactor, sText, WHITE,4U,width/scale.x*4); } } } @@ -3564,15 +3564,15 @@ namespace olc Clear(BLANK); DrawStringProp({0,0},sText,WHITE,1U,width/scale.x); newDecal->Update(); - float adjustedShadowSizeFactor=shadowSizeFactor*4/std::max(scale.x,scale.y); - Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor*2)); + vf2d adjustedShadowSizeFactor=vf2d{shadowSizeFactor,shadowSizeFactor}*4/scale; + Decal*newShadowDecal=new Decal(new Sprite((imageSize.x/scale.x*4)+adjustedShadowSizeFactor.x*2,(imageSize.y/scale.x*4)+adjustedShadowSizeFactor.y*2)); garbageCollector[key+"_SHADOW"].decal=newShadowDecal; SetDrawTarget(newShadowDecal->sprite); Clear(BLANK); - for(float y=-adjustedShadowSizeFactor;y<=adjustedShadowSizeFactor+0.1;y+=adjustedShadowSizeFactor/2){ - for(float x=-adjustedShadowSizeFactor;x<=adjustedShadowSizeFactor+0.1;x+=adjustedShadowSizeFactor/2){ + for(float y=-adjustedShadowSizeFactor.y;y<=adjustedShadowSizeFactor.y+0.1;y+=adjustedShadowSizeFactor.y/2){ + for(float x=-adjustedShadowSizeFactor.x;x<=adjustedShadowSizeFactor.x+0.1;x+=adjustedShadowSizeFactor.x/2){ if(x!=0||y!=0){ - DrawStringProp(vf2d{x,y}+vf2d{adjustedShadowSizeFactor,adjustedShadowSizeFactor}, sText, WHITE,4U,width/scale.x*4); + DrawStringProp(vf2d{x,y}+adjustedShadowSizeFactor, sText, WHITE,4U,width/scale.x*4); } } } diff --git a/Crawler/olcUTIL_Animate2D.h b/Crawler/olcUTIL_Animate2D.h index e676c09f..85330ad8 100644 --- a/Crawler/olcUTIL_Animate2D.h +++ b/Crawler/olcUTIL_Animate2D.h @@ -188,7 +188,7 @@ namespace olc::utils::Animate2D // Update an animation state token inline void UpdateState(AnimationState& state, const float fElapsedTime) const { - state.fTime += std::fmod(fElapsedTime,1000); + state.fTime = std::fmod(state.fTime+fElapsedTime,1000); } public: diff --git a/Crawler/pixelGameEngine.cpp b/Crawler/pixelGameEngine.cpp index a6680bf1..3073dcb5 100644 --- a/Crawler/pixelGameEngine.cpp +++ b/Crawler/pixelGameEngine.cpp @@ -49,7 +49,5 @@ All rights reserved. #include "TMXParser.h" #define TSX_PARSER_SETUP #include "TSXParser.h" -#define OLC_PGEX_GRAPHICS2D -#include "olcPGEX_Graphics2D.h" #define OLC_PGEX_MINIAUDIO #include "olcPGEX_MiniAudio.h" \ No newline at end of file