|
|
@ -75,8 +75,8 @@ class Object{ |
|
|
|
Pixel color=WHITE; |
|
|
|
Pixel color=WHITE; |
|
|
|
vd2d originPoint={0,0}; |
|
|
|
vd2d originPoint={0,0}; |
|
|
|
bool drawn=false; |
|
|
|
bool drawn=false; |
|
|
|
int disableFlag; |
|
|
|
Flag disableFlag=Flag::NONE; |
|
|
|
int enableFlag; |
|
|
|
Flag enableFlag=Flag::NONE; |
|
|
|
int objArrElement; //Which element in the object array this object is located in. For sorting purposes.
|
|
|
|
int objArrElement; //Which element in the object array this object is located in. For sorting purposes.
|
|
|
|
bool temp=false; //If set to true, it's marked for deletion after cutscene handling.
|
|
|
|
bool temp=false; //If set to true, it's marked for deletion after cutscene handling.
|
|
|
|
//animationSpd is how long to wait before switching frames.
|
|
|
|
//animationSpd is how long to wait before switching frames.
|
|
|
@ -135,6 +135,7 @@ public: |
|
|
|
Cutscene*TestCutscene; |
|
|
|
Cutscene*TestCutscene; |
|
|
|
Cutscene*CurrentCutscene=nullptr; |
|
|
|
Cutscene*CurrentCutscene=nullptr; |
|
|
|
ActionType CurrentAction=ActionType::NONE; |
|
|
|
ActionType CurrentAction=ActionType::NONE; |
|
|
|
|
|
|
|
double CUTSCENE_FADE_VALUE=0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
|
|
|
|
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
|
|
|
@ -164,9 +165,9 @@ public: |
|
|
|
SetupAnimations(); |
|
|
|
SetupAnimations(); |
|
|
|
SetupObjectInfo(); |
|
|
|
SetupObjectInfo(); |
|
|
|
|
|
|
|
|
|
|
|
GAME_FLAGS[Flag::TEST_FLAG1]=true; |
|
|
|
SetGameFlag(Flag::TEST_FLAG1,false); |
|
|
|
GAME_FLAGS[Flag::TEST_FLAG2]=false; |
|
|
|
SetGameFlag(Flag::TEST_FLAG2,false); |
|
|
|
GAME_FLAGS[Flag::TEST_FLAG3]=true; |
|
|
|
SetGameFlag(Flag::TEST_FLAG3,false); |
|
|
|
|
|
|
|
|
|
|
|
additionalChars[0x391]={0,0}; |
|
|
|
additionalChars[0x391]={0,0}; |
|
|
|
additionalChars[0x392]={8,0}; |
|
|
|
additionalChars[0x392]={8,0}; |
|
|
@ -181,6 +182,7 @@ public: |
|
|
|
LoadMap(MAP_ONETT); |
|
|
|
LoadMap(MAP_ONETT); |
|
|
|
|
|
|
|
|
|
|
|
TestCutscene=new Cutscene({ |
|
|
|
TestCutscene=new Cutscene({ |
|
|
|
|
|
|
|
(CutsceneAction*)new SetFlagWhenCutsceneEnds(Flag::TEST_FLAG1), |
|
|
|
(CutsceneAction*)new PanCamera({128,128},BOTH), |
|
|
|
(CutsceneAction*)new PanCamera({128,128},BOTH), |
|
|
|
(CutsceneAction*)new PanCamera({128,0},BOTH), |
|
|
|
(CutsceneAction*)new PanCamera({128,0},BOTH), |
|
|
|
(CutsceneAction*)new CreateObjects({ |
|
|
|
(CutsceneAction*)new CreateObjects({ |
|
|
@ -195,8 +197,6 @@ in some form or capacity or another. Even though it |
|
|
|
goes on a very long time, I hope you can understand this is only for testing purposes! |
|
|
|
goes on a very long time, I hope you can understand this is only for testing purposes! |
|
|
|
)");*/ |
|
|
|
)");*/ |
|
|
|
|
|
|
|
|
|
|
|
StartCutscene(TestCutscene); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -258,7 +258,15 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
CurrentCutscene->LockAction(); |
|
|
|
CurrentCutscene->LockAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!GetGameFlag(Flag::TEST_FLAG1)) { |
|
|
|
|
|
|
|
StartCutscene(TestCutscene); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (CurrentAction) { |
|
|
|
switch (CurrentAction) { |
|
|
|
|
|
|
|
case ActionType::SET_FLAG_WHEN_CUTSCENE_ENDS:{ |
|
|
|
|
|
|
|
CurrentCutscene->SetupEndingCutsceneFlag(((SetFlagWhenCutsceneEnds*)CurrentCutscene->GetAction())->GetCutsceneEndingFlag(),((SetFlagWhenCutsceneEnds*)CurrentCutscene->GetAction())->GetCutsceneEndingVal()); |
|
|
|
|
|
|
|
CurrentCutscene->AdvanceAction(); |
|
|
|
|
|
|
|
}break; |
|
|
|
case ActionType::PAN_CAMERA:{ |
|
|
|
case ActionType::PAN_CAMERA:{ |
|
|
|
if (MoveCameraTowardsPoint((PanCamera*)CurrentCutscene->GetAction())) { |
|
|
|
if (MoveCameraTowardsPoint((PanCamera*)CurrentCutscene->GetAction())) { |
|
|
|
CurrentCutscene->AdvanceAction(); |
|
|
|
CurrentCutscene->AdvanceAction(); |
|
|
@ -279,10 +287,12 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
} |
|
|
|
} |
|
|
|
CurrentCutscene->CleanupCutscene(); |
|
|
|
CurrentCutscene->CleanupCutscene(); |
|
|
|
CurrentCutscene->ResetCutscene(); |
|
|
|
CurrentCutscene->ResetCutscene(); |
|
|
|
|
|
|
|
SetGameFlag(CurrentCutscene->GetEndingCutsceneFlag(),CurrentCutscene->GetEndingCutsceneVal()); |
|
|
|
CurrentCutscene=nullptr; |
|
|
|
CurrentCutscene=nullptr; |
|
|
|
StartCutscene(TestCutscene); |
|
|
|
CurrentAction=ActionType::NONE; |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (GAME_STATE) { |
|
|
|
switch (GAME_STATE) { |
|
|
|
case GameState::TILE_SELECT:{ |
|
|
|
case GameState::TILE_SELECT:{ |
|
|
@ -614,6 +624,7 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
DrawStringPropDecal({6,6},messageBoxText); |
|
|
|
DrawStringPropDecal({6,6},messageBoxText); |
|
|
|
} |
|
|
|
} |
|
|
|
SetDrawTarget(layer::INTERFACE); |
|
|
|
SetDrawTarget(layer::INTERFACE); |
|
|
|
|
|
|
|
FillRectDecal({0,0},{WIDTH,HEIGHT},Pixel(0,0,0,(int)CUTSCENE_FADE_VALUE)); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
void DrawFancyStringDecal(const olc::vf2d& pos, const std::wstring& sText, const Pixel col = olc::WHITE, const olc::vf2d& scale = { 1.0f, 1.0f }) { |
|
|
|
void DrawFancyStringDecal(const olc::vf2d& pos, const std::wstring& sText, const Pixel col = olc::WHITE, const olc::vf2d& scale = { 1.0f, 1.0f }) { |
|
|
@ -705,12 +716,12 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
|
|
|
|
|
|
|
bool enabled=true; |
|
|
|
bool enabled=true; |
|
|
|
if (OBJ_INFO[id]->disableFlag!=Flag::NONE) { |
|
|
|
if (OBJ_INFO[id]->disableFlag!=Flag::NONE) { |
|
|
|
if (GAME_FLAGS[OBJ_INFO[id]->disableFlag]) { |
|
|
|
if (GetGameFlag(OBJ_INFO[id]->disableFlag)) { |
|
|
|
enabled=false; |
|
|
|
enabled=false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (OBJ_INFO[id]->enableFlag!=Flag::NONE) { |
|
|
|
if (OBJ_INFO[id]->enableFlag!=Flag::NONE) { |
|
|
|
if (!GAME_FLAGS[OBJ_INFO[id]->enableFlag]) { |
|
|
|
if (!GetGameFlag(OBJ_INFO[id]->enableFlag)) { |
|
|
|
enabled=false; |
|
|
|
enabled=false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -836,7 +847,7 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
return new Object(id,OBJ_INFO[id]->name,pos,OBJ_INFO[id]->spr,OBJ_INFO[id]->scale,OBJ_INFO[id]->color,OBJ_INFO[id]->animationSpd); |
|
|
|
return new Object(id,OBJ_INFO[id]->name,pos,OBJ_INFO[id]->spr,OBJ_INFO[id]->scale,OBJ_INFO[id]->color,OBJ_INFO[id]->animationSpd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Object*CreateObjectInfo(Reference ref,std::string name,vd2d pos,std::string spriteFileName,int sprWidth,vd2d scale={1,1},Pixel tint=WHITE,int enableFlag=Flag::NONE,int disableFlag=Flag::NONE,int animationDelay=1) { |
|
|
|
Object*CreateObjectInfo(Reference ref,std::string name,vd2d pos,std::string spriteFileName,int sprWidth,vd2d scale={1,1},Pixel tint=WHITE,Flag enableFlag=Flag::NONE,Flag disableFlag=Flag::NONE,int animationDelay=1) { |
|
|
|
if (!ANIMATIONS.count(spriteFileName)) { |
|
|
|
if (!ANIMATIONS.count(spriteFileName)) { |
|
|
|
ANIMATIONS[spriteFileName] = new Animation(SPRITES[spriteFileName]=CreateSprite(spriteFileName),32); |
|
|
|
ANIMATIONS[spriteFileName] = new Animation(SPRITES[spriteFileName]=CreateSprite(spriteFileName),32); |
|
|
|
} |
|
|
|
} |
|
|
@ -1270,6 +1281,14 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
} |
|
|
|
} |
|
|
|
return reachedPosition; |
|
|
|
return reachedPosition; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetGameFlag(Flag flag,bool val) { |
|
|
|
|
|
|
|
GAME_FLAGS[flagint(flag)]=val; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool GetGameFlag(Flag flag) { |
|
|
|
|
|
|
|
return GAME_FLAGS[flagint(flag)]; |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|