diff --git a/C++ProjectTemplate b/C++ProjectTemplate index a37c3db..a81f570 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/SeasonI.h b/SeasonI.h index 1f50bd4..d96b223 100644 --- a/SeasonI.h +++ b/SeasonI.h @@ -71,7 +71,7 @@ class SeasonI:public PixelGameEngine{ bool LeftReleased(); bool RightReleased(); bool PlayerCanMove(); - void UpdatePlayerTrail(vd2d newMovement); + void UpdatePlayerTrail(vd2d newMovement,Direction newFacingDir); void SetupRollingHitpointCounters(); void AdvanceMessageBox(); //CAMERA UPDATES MUST BE LAST!!! COLLISIONS RELY ON THE GAME POSITION STATES REMAINING THE SAME! diff --git a/assets/player.png b/assets/player.png index 9aca218..f51261e 100644 Binary files a/assets/player.png and b/assets/player.png differ diff --git a/defines.h b/defines.h index a8c970c..0fe6006 100644 --- a/defines.h +++ b/defines.h @@ -62,6 +62,10 @@ enum class Direction{ EAST, WEST, NORTH, + SOUTHWEST, + SOUTHEAST, + NORTHEAST, + NORTHWEST, }; diff --git a/main.cpp b/main.cpp index 41b3c83..51e6d31 100644 --- a/main.cpp +++ b/main.cpp @@ -62,7 +62,7 @@ int EDITING_LAYER=layer::DYNAMIC; int SELECTED_OBJ_ID = PLAYER; int OBJ_DISPLAY_OFFSET = 0; bool GAME_FLAGS[128]={}; -std::array PARTY_MEMBER_OBJ={}; +std::array PARTY_MEMBER_OBJ={}; std::array PARTY_MEMBER_ID={}; std::array PARTY_MEMBER_STATS={}; bool messageBoxVisible=false; @@ -80,7 +80,7 @@ ActionType CurrentAction=ActionType::NONE; double CUTSCENE_FADE_VALUE=0; std::vectorCUTSCENE_QUEUE={}; std::mapMOVELIST={}; -std::array partyTrail={vd2d{0,0}}; +std::array,PARTY_TRAIL_LENGTH> partyTrail={std::pair{{0,0},Direction::SOUTH}}; int PARTY_MEMBER_COUNT = 1; int ENCOUNTER_SELECTED = 0; int ENCOUNTER_OFFSET = 0; @@ -428,172 +428,172 @@ void SeasonI::SetupAnimations() { } void SeasonI::SetupObjectInfo() { - CreateObjectInfo(new Standard_Obj(PLAYER,"player",{0,0},nullptr,{2,2},WHITE,32),"player.png",{32,32}); - CreateObjectInfo(new Standard_Obj(NESS,"Ness",{0,0},nullptr,{1,1},YELLOW,32),"player.png",{32,32}); - CreateObjectInfo(new Standard_Obj(PAULA,"Paula",{0,0},nullptr,{1,1},MAGENTA,32),"player.png",{32,32}); - CreateObjectInfo(new Standard_Obj(JEFF,"Jeff",{0,0},nullptr,{1,1},DARK_GREEN,32),"player.png",{32,32}); - CreateObjectInfo(new Standard_Obj(ANNA,"Anna",{0,0},nullptr,{1,1},DARK_MAGENTA,32),"player.png",{32,32}); - CreateObjectInfo(new Standard_Obj(KING,"King",{0,0},nullptr,{1,1},GREY,32),"player.png",{32,32}); - CreateObjectInfo(new Standard_Obj(POO,"Poo",{0,0},nullptr,{1,1},DARK_GREY,32),"player.png",{32,32}); - CreateObjectInfo(new Standard_Obj(NPC1,"npc1",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2,"npc2",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3,"npc3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4,"npc4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5,"npc5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6,"npc6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7,"npc7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8,"npc8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9,"npc9",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10,"npc10",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11,"npc11",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12,"npc12",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13,"npc13",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13,"npc14",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14,"npc15",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15,"npc16",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16,"npc17",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17,"npc18",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18,"npc19",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC19,"npc20",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC1_2,"npc1_2",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2_2,"npc2_2",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3_2,"npc3_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4_2,"npc4_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5_2,"npc5_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6_2,"npc6_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7_2,"npc7_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8_2,"npc8_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9_2,"npc9_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10_2,"npc10_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11_2,"npc11_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12_2,"npc12_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_2,"npc13_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_2,"npc14_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14_2,"npc15_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15_2,"npc16_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16_2,"npc17_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17_2,"npc18_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18_2,"npc19_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC19_2,"npc20_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC1_3,"npc1_3",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2_3,"npc2_3",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3_3,"npc3_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4_3,"npc4_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5_3,"npc5_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6_3,"npc6_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7_3,"npc7_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8_3,"npc8_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9_3,"npc9_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10_3,"npc10_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11_3,"npc11_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12_3,"npc12_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_3,"npc13_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_3,"npc14_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14_3,"npc15_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15_3,"npc16_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16_3,"npc17_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17_3,"npc18_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18_3,"npc19_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC19_3,"npc20_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC1_4,"npc1_4",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2_4,"npc2_4",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3_4,"npc3_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4_4,"npc4_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5_4,"npc5_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6_4,"npc6_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7_4,"npc7_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8_4,"npc8_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9_4,"npc9_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10_4,"npc10_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11_4,"npc11_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12_4,"npc12_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_4,"npc13_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_4,"npc14_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14_4,"npc15_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15_4,"npc16_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16_4,"npc17_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17_4,"npc18_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18_4,"npc19_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC19_4,"npc20_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC1_5,"npc1_5",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2_5,"npc2_5",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3_5,"npc3_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4_5,"npc4_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5_5,"npc5_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6_5,"npc6_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7_5,"npc7_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8_5,"npc8_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9_5,"npc9_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10_5,"npc10_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11_5,"npc11_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12_5,"npc12_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_5,"npc13_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_5,"npc14_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14_5,"npc15_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15_5,"npc16_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16_5,"npc17_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17_5,"npc18_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18_5,"npc19_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC19_5,"npc20_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC1_6,"npc1_6",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2_6,"npc2_6",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3_6,"npc3_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4_6,"npc4_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5_6,"npc5_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6_6,"npc6_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7_6,"npc7_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8_6,"npc8_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9_6,"npc9_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10_6,"npc10_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11_6,"npc11_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12_6,"npc12_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_6,"npc13_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_6,"npc14_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14_6,"npc15_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15_6,"npc16_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16_6,"npc17_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17_6,"npc18_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18_6,"npc19_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC19_6,"npc20_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC1_7,"npc1_7",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2_7,"npc2_7",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3_7,"npc3_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4_7,"npc4_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5_7,"npc5_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6_7,"npc6_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7_7,"npc7_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8_7,"npc8_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9_7,"npc9_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10_7,"npc10_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11_7,"npc11_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12_7,"npc12_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_7,"npc13_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_7,"npc14_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14_7,"npc15_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15_7,"npc16_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16_7,"npc17_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17_7,"npc18_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18_7,"npc19_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC19_7,"npc20_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC1_8,"npc1_8",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC2_8,"npc2_8",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC3_8,"npc3_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC4_8,"npc4_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC5_8,"npc5_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC6_8,"npc6_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC7_8,"npc7_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC8_8,"npc8_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC9_8,"npc9_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC10_8,"npc10_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC11_8,"npc11_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC12_8,"npc12_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_8,"npc13_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC13_8,"npc14_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC14_8,"npc15_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC15_8,"npc16_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC16_8,"npc17_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC17_8,"npc18_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); - CreateObjectInfo(new Standard_Obj(NPC18_8,"npc19_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(PLAYER,"player",{0,0},nullptr,{2,2},WHITE,32),"player.png",{32,32}); + CreateObjectInfo(new NPC_Obj(NESS,"Ness",{0,0},nullptr,{1,1},YELLOW,32),"player.png",{32,32}); + CreateObjectInfo(new NPC_Obj(PAULA,"Paula",{0,0},nullptr,{1,1},MAGENTA,32),"player.png",{32,32}); + CreateObjectInfo(new NPC_Obj(JEFF,"Jeff",{0,0},nullptr,{1,1},DARK_GREEN,32),"player.png",{32,32}); + CreateObjectInfo(new NPC_Obj(ANNA,"Anna",{0,0},nullptr,{1,1},DARK_MAGENTA,32),"player.png",{32,32}); + CreateObjectInfo(new NPC_Obj(KING,"King",{0,0},nullptr,{1,1},GREY,32),"player.png",{32,32}); + CreateObjectInfo(new NPC_Obj(POO,"Poo",{0,0},nullptr,{1,1},DARK_GREY,32),"player.png",{32,32}); + CreateObjectInfo(new NPC_Obj(NPC1,"npc1",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2,"npc2",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3,"npc3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4,"npc4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5,"npc5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6,"npc6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7,"npc7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8,"npc8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9,"npc9",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10,"npc10",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11,"npc11",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12,"npc12",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13,"npc13",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13,"npc14",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14,"npc15",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15,"npc16",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16,"npc17",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17,"npc18",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18,"npc19",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC19,"npc20",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC1_2,"npc1_2",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2_2,"npc2_2",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3_2,"npc3_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4_2,"npc4_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5_2,"npc5_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6_2,"npc6_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7_2,"npc7_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8_2,"npc8_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9_2,"npc9_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10_2,"npc10_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11_2,"npc11_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12_2,"npc12_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_2,"npc13_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_2,"npc14_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14_2,"npc15_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15_2,"npc16_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16_2,"npc17_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17_2,"npc18_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18_2,"npc19_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC19_2,"npc20_2",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC1_3,"npc1_3",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2_3,"npc2_3",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3_3,"npc3_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4_3,"npc4_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5_3,"npc5_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6_3,"npc6_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7_3,"npc7_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8_3,"npc8_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9_3,"npc9_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10_3,"npc10_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11_3,"npc11_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12_3,"npc12_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_3,"npc13_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_3,"npc14_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14_3,"npc15_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15_3,"npc16_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16_3,"npc17_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17_3,"npc18_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18_3,"npc19_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC19_3,"npc20_3",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC1_4,"npc1_4",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2_4,"npc2_4",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3_4,"npc3_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4_4,"npc4_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5_4,"npc5_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6_4,"npc6_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7_4,"npc7_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8_4,"npc8_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9_4,"npc9_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10_4,"npc10_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11_4,"npc11_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12_4,"npc12_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_4,"npc13_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_4,"npc14_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14_4,"npc15_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15_4,"npc16_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16_4,"npc17_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17_4,"npc18_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18_4,"npc19_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC19_4,"npc20_4",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC1_5,"npc1_5",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2_5,"npc2_5",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3_5,"npc3_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4_5,"npc4_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5_5,"npc5_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6_5,"npc6_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7_5,"npc7_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8_5,"npc8_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9_5,"npc9_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10_5,"npc10_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11_5,"npc11_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12_5,"npc12_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_5,"npc13_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_5,"npc14_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14_5,"npc15_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15_5,"npc16_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16_5,"npc17_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17_5,"npc18_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18_5,"npc19_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC19_5,"npc20_5",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC1_6,"npc1_6",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2_6,"npc2_6",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3_6,"npc3_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4_6,"npc4_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5_6,"npc5_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6_6,"npc6_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7_6,"npc7_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8_6,"npc8_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9_6,"npc9_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10_6,"npc10_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11_6,"npc11_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12_6,"npc12_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_6,"npc13_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_6,"npc14_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14_6,"npc15_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15_6,"npc16_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16_6,"npc17_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17_6,"npc18_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18_6,"npc19_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC19_6,"npc20_6",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC1_7,"npc1_7",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2_7,"npc2_7",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3_7,"npc3_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4_7,"npc4_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5_7,"npc5_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6_7,"npc6_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7_7,"npc7_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8_7,"npc8_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9_7,"npc9_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10_7,"npc10_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11_7,"npc11_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12_7,"npc12_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_7,"npc13_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_7,"npc14_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14_7,"npc15_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15_7,"npc16_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16_7,"npc17_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17_7,"npc18_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18_7,"npc19_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC19_7,"npc20_7",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC1_8,"npc1_8",{0,0},nullptr,{1,1},RED,60),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC2_8,"npc2_8",{0,0},nullptr,{1,1},GREEN,2),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC3_8,"npc3_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC4_8,"npc4_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC5_8,"npc5_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC6_8,"npc6_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC7_8,"npc7_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC8_8,"npc8_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC9_8,"npc9_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC10_8,"npc10_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC11_8,"npc11_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC12_8,"npc12_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_8,"npc13_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC13_8,"npc14_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC14_8,"npc15_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC15_8,"npc16_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC16_8,"npc17_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC17_8,"npc18_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); + CreateObjectInfo(new NPC_Obj(NPC18_8,"npc19_8",{0,0},nullptr,{2,2},BLUE,20),"player.png",{32,32},Flag::NONE,Flag::NONE); CreateObjectInfo(new Shopkeeper_Obj(SHOPKEEPER,"Shopkeeper",{0,0},nullptr,{1,1},YELLOW,20),"player.png",{32,32},Flag::NONE,Flag::NONE); CreateObjectInfo(new TrashCan_Obj(TRASH_CAN,"trashCan",{0,0},nullptr,{1,1},WHITE,0),"trashcan.png",{32,32},Flag::NONE,Flag::NONE); } @@ -1077,14 +1077,14 @@ Object*SeasonI::CreateObject(int id,vd2d pos) { Object*SeasonI::AddObjectToWorld(Object*obj) { std::vector::const_iterator it = OBJECTS.begin(); if (obj->id==PLAYER&&!obj->temp) { - PARTY_MEMBER_OBJ[0]=obj; + PARTY_MEMBER_OBJ[0]=(NPC_Obj*)obj; PARTY_MEMBER_ID[0]=0; PARTY_MEMBER_OBJ[0]->name="PLAYER"; PARTY_MEMBER_STATS[PARTY_MEMBER_ID[0]]->obj=PARTY_MEMBER_OBJ[0]; for (int i=(int)Flag::HAS_MAIN+1;i<=(int)Flag::HAS_POO;i++) { if (GetGameFlag(i)) { PARTY_MEMBER_ID[PARTY_MEMBER_COUNT]=(int)PLAYER+i-(int)Flag::HAS_MAIN; - PARTY_MEMBER_OBJ[PARTY_MEMBER_COUNT]=AddObjectToWorld(CreateObject((int)PLAYER+i-(int)Flag::HAS_MAIN,PARTY_MEMBER_OBJ[0]->GetPos())); + PARTY_MEMBER_OBJ[PARTY_MEMBER_COUNT]=(NPC_Obj*)AddObjectToWorld(CreateObject((int)PLAYER+i-(int)Flag::HAS_MAIN,PARTY_MEMBER_OBJ[0]->GetPos())); switch ((int)PLAYER+i-(int)Flag::HAS_MAIN) { case 0:{PARTY_MEMBER_OBJ[PARTY_MEMBER_COUNT]->name="PLAYER";}break; case 1:{PARTY_MEMBER_OBJ[PARTY_MEMBER_COUNT]->name="NESS";}break; @@ -1270,21 +1270,52 @@ void SeasonI::updateGame(){ if (PlayerCanMove()) { bool moved=false; vd2d movementComponents = {0,0}; + Direction facingDir=Direction::SOUTH; if (UpHeld()) { movementComponents.y-=1; + facingDir=Direction::NORTH; + if (RightHeld()) { + facingDir=Direction::NORTHEAST; + } + if (LeftHeld()) { + facingDir=Direction::NORTHWEST; + } } if (DownHeld()) { movementComponents.y+=1; + facingDir=Direction::SOUTH; + if (RightHeld()) { + facingDir=Direction::SOUTHEAST; + } + if (LeftHeld()) { + facingDir=Direction::SOUTHWEST; + } } if (LeftHeld()) { movementComponents.x-=1; + facingDir=Direction::WEST; + if (UpHeld()) { + facingDir=Direction::NORTHWEST; + } + if (DownHeld()) { + facingDir=Direction::SOUTHWEST; + } } if (RightHeld()) { movementComponents.x+=1; + facingDir=Direction::EAST; + if (UpHeld()) { + facingDir=Direction::NORTHEAST; + } + if (DownHeld()) { + facingDir=Direction::SOUTHEAST; + } } + PARTY_MEMBER_OBJ[0]->animationSubIndex=(int)facingDir; if (movementComponents.mag()>0) { + PARTY_MEMBER_OBJ[0]->frameIndex+=frameCount%PARTY_MEMBER_OBJ[0]->originalAnimationSpd==0; if (PARTY_MEMBER_OBJ[0]->SmoothMove(movementComponents)) { - UpdatePlayerTrail(movementComponents); + UpdatePlayerTrail(movementComponents,facingDir); for (int i=0;itriggers.size();i++) { if (CURRENT_MAP->triggers[i]->IsInside(PARTY_MEMBER_OBJ[0]->GetPosWithOrigin())) { CURRENT_MAP->triggers[i]->Interact(); @@ -1330,28 +1361,6 @@ void SeasonI::updateGame(){ GAME_STATE=GameState::TRIGGER_SELECT; SELECTED_TRIGGER=TriggerName::NONE; } - if (PlayerCanMove()) { - if (GetKey(I).bHeld) { - if (PARTY_MEMBER_OBJ[0]->SmoothMove({0,-1})) { - UpdatePlayerTrail({0,-1}); - } - } - if (GetKey(K).bHeld) { - if (PARTY_MEMBER_OBJ[0]->SmoothMove({0,1})) { - UpdatePlayerTrail({0,1}); - } - } - if (GetKey(J).bHeld) { - if (PARTY_MEMBER_OBJ[0]->SmoothMove({-1,0})) { - UpdatePlayerTrail({-1,0}); - } - } - if (GetKey(L).bHeld) { - if (PARTY_MEMBER_OBJ[0]->SmoothMove({1,0})) { - UpdatePlayerTrail({1,0}); - } - } - } int selectedTileX=(GetMouseX()+cameraPos.x)/32; int selectedTileY=(GetMouseY()+cameraPos.y)/32; if (selectedTileX=0&&selectedTileY>=0) { @@ -3922,14 +3931,16 @@ bool SeasonI::PlayerCanMove(){ return GAME_STATE==GameState::GAME_WORLD&&BATTLE_ENCOUNTER==nullptr&&!IsTextEntryEnabled()&&!messageBoxVisible&&PARTY_MEMBER_OBJ[0]!=nullptr&&CurrentCutscene==nullptr; } -void SeasonI::UpdatePlayerTrail(vd2d newMovement) { +void SeasonI::UpdatePlayerTrail(vd2d newMovement,Direction newFacingDir) { for (int i=PARTY_TRAIL_LENGTH-1;i>0;i--) { partyTrail[i]=partyTrail[i-1]; } - partyTrail[0]={PARTY_MEMBER_OBJ[0]->GetPos().x-newMovement.x+PARTY_MEMBER_OBJ[0]->spr->sprSize.x*0.5*(PARTY_MEMBER_OBJ[0]->GetScale().x-1), - PARTY_MEMBER_OBJ[0]->GetPos().y-newMovement.y+(PARTY_MEMBER_OBJ[0]->spr->sprSize.y-4)*(PARTY_MEMBER_OBJ[0]->GetScale().y-1)}; + partyTrail[0]={{PARTY_MEMBER_OBJ[0]->GetPos().x-newMovement.x+PARTY_MEMBER_OBJ[0]->spr->sprSize.x*0.5*(PARTY_MEMBER_OBJ[0]->GetScale().x-1), + PARTY_MEMBER_OBJ[0]->GetPos().y-newMovement.y+(PARTY_MEMBER_OBJ[0]->spr->sprSize.y-4)*(PARTY_MEMBER_OBJ[0]->GetScale().y-1)},newFacingDir}; for (int i=1;iSetPos(partyTrail[PARTY_TRAIL_LENGTH*((double)i/4)]); + PARTY_MEMBER_OBJ[i]->SetPos(partyTrail[PARTY_TRAIL_LENGTH*((double)i/4)].first); + PARTY_MEMBER_OBJ[i]->animationSubIndex=(int)partyTrail[PARTY_TRAIL_LENGTH*((double)i/4)].second; + PARTY_MEMBER_OBJ[i]->frameIndex+=(int)(PARTY_TRAIL_LENGTH*((double)i/4))%PARTY_MEMBER_OBJ[i]->originalAnimationSpd==0; } } @@ -4407,7 +4418,7 @@ void SeasonI::DrawGameWorld() { accX+=obj->GetScale().x; for (int yy=0;yyspr->sprSize.y;yy++) { accY+=obj->GetScale().y; - Pixel col = data[yy*96+xx+((obj->frameIndex%obj->spr->frames)*obj->spr->sprSize.x)]; + Pixel col = data[yy*obj->spr->spr->sprite->width+xx+((obj->frameIndex%obj->spr->frames)*obj->spr->sprSize.x)]; while (accY>=1) { for (int xxx=0;xxx64) { diff --git a/object.h b/object.h index 507f07d..c883069 100644 --- a/object.h +++ b/object.h @@ -55,7 +55,7 @@ class Object{ } //A grid version of the constructor. used ONLY for battle setups. Object(int id,std::string name,int gridx,int gridy,Animation*spr,vd2d scale={1,1},Pixel color=WHITE,int animationSpd=1,bool temp=false,ObjectExtraData data={moveTime:0,moveFreq:0,moveSpd:0}) - :Object(id,name,{gridx*32-(spr->sprSize.x*0.5)*(scale.x-1),gridy*32-(spr->spr->sprite->height-4)*(scale.y-1)},spr,scale,color,animationSpd,temp,data) {} + :Object(id,name,{gridx*32-(spr->sprSize.x*0.5)*(scale.x-1),gridy*32-(spr->sprSize.y-4)*(scale.y-1)},spr,scale,color,animationSpd,temp,data) {} Object(int id,std::string name,vd2d pos,Animation*spr,vd2d scale={1,1},Pixel color=WHITE,int animationSpd=1,bool temp=false,ObjectExtraData data={moveTime:0,moveFreq:0,moveSpd:0}) :spr(spr),pos(pos),id(id),name(name),color(color),animationSpd(animationSpd),temp(temp),extraData(data) { SetScale(scale); @@ -70,7 +70,7 @@ class Object{ void SetScale(vd2d scale) { this->scale=scale; if (spr!=nullptr) { - this->originPoint={spr->sprSize.x/2*scale.x,(spr->sprSize.y-4)*scale.y}; + this->originPoint={(double)spr->sprSize.x/2*scale.x,(spr->sprSize.y-4)*scale.y}; } } vd2d GetScale() { @@ -189,8 +189,13 @@ class Standard_Obj : public Object{ class NPC_Obj : public Standard_Obj{ float remainingMoveTime=0; Direction moveDir=Direction::SOUTH; + public: + int originalAnimationSpd=0; NPC_Obj(int id,std::string name,vd2d pos,Animation*spr,vd2d scale={1,1},Pixel color=WHITE,int animationSpd=1,bool temp=false)\ - :Standard_Obj(id,name,pos,spr,scale,color,animationSpd,temp){} + :Standard_Obj(id,name,pos,spr,scale,color,animationSpd,temp),originalAnimationSpd(animationSpd){ + animationSpd=0; + frameIndex=0; + } void Update(float fElapsedTime)override{ if (rand()%extraData.moveFreq==0) { remainingMoveTime=extraData.moveTime; @@ -198,6 +203,8 @@ class NPC_Obj : public Standard_Obj{ } if (remainingMoveTime>0) { vd2d moveVector; + animationSubIndex=(int)moveDir; + animationSpd=originalAnimationSpd; switch (moveDir) { case Direction::SOUTH:{ moveVector={0,1}; @@ -214,6 +221,8 @@ class NPC_Obj : public Standard_Obj{ } SmoothMove(moveVector*extraData.moveSpd); remainingMoveTime-=fElapsedTime; + } else { + animationSpd=0; } } };