|
|
|
@ -192,6 +192,7 @@ public: |
|
|
|
|
(CutsceneAction*)new SetFlagWhenCutsceneEnds(Flag::TEST_FLAG1), |
|
|
|
|
(CutsceneAction*)new PanCamera({128,128},BOTH), |
|
|
|
|
(CutsceneAction*)new PanCamera({64,0},BOTH), |
|
|
|
|
(CutsceneAction*)new MoveCutsceneObject(1,{80,64}), |
|
|
|
|
(CutsceneAction*)new DialogBox(R"(Hello! |
|
|
|
|
This is a test message that lets us trigger straight from a cutscene! Cool!)"),}); |
|
|
|
|
|
|
|
|
@ -276,6 +277,11 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
CurrentCutscene->AdvanceAction(); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case ActionType::MOVE_CUTSCENE_OBJ:{ |
|
|
|
|
if (MoveObjectTowardsPoint(CurrentCutscene->GetCutsceneObjects()[((MoveCutsceneObject*)CurrentCutscene->GetAction())->GetObjectID()],((MoveCutsceneObject*)CurrentCutscene->GetAction())->GetTargetPos(),((MoveCutsceneObject*)CurrentCutscene->GetAction())->GetMovement(),((MoveCutsceneObject*)CurrentCutscene->GetAction())->GetMoveSpd())) { |
|
|
|
|
CurrentCutscene->AdvanceAction(); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case ActionType::CREATE_OBJECTS:{ |
|
|
|
|
for (auto&obj:((CreateObjects*)CurrentCutscene->GetAction())->GetObjects()) { |
|
|
|
|
obj->temp=true; |
|
|
|
@ -1309,6 +1315,49 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
return reachedPosition; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool MoveObjectTowardsPoint(Object*obj,vd2d targetPos,PriorityDirection dir,double moveSpd,bool secondRun=false) { |
|
|
|
|
bool reachedPosition=true; |
|
|
|
|
if (dir==HORZ_FIRST||dir==BOTH) { |
|
|
|
|
if (obj->pos.x!=targetPos.x) { |
|
|
|
|
if (obj->pos.x<targetPos.x) { |
|
|
|
|
obj->pos.x+=moveSpd; |
|
|
|
|
if (obj->pos.x>targetPos.x) { |
|
|
|
|
obj->pos.x=targetPos.x; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
obj->pos.x-=moveSpd; |
|
|
|
|
if (obj->pos.x<targetPos.x) { |
|
|
|
|
obj->pos.x=targetPos.x; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
reachedPosition=false; |
|
|
|
|
} else
|
|
|
|
|
if (!secondRun&&dir!=BOTH) { |
|
|
|
|
MoveObjectTowardsPoint(obj,targetPos,dir,moveSpd,true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (dir==VERT_FIRST||dir==BOTH) { |
|
|
|
|
if (obj->pos.y!=targetPos.y) { |
|
|
|
|
if (obj->pos.y<targetPos.y) { |
|
|
|
|
obj->pos.y+=moveSpd; |
|
|
|
|
if (obj->pos.y>targetPos.y) { |
|
|
|
|
obj->pos.y=targetPos.y; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
obj->pos.y-=moveSpd; |
|
|
|
|
if (obj->pos.y<targetPos.y) { |
|
|
|
|
obj->pos.y=targetPos.y; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
reachedPosition=false; |
|
|
|
|
} else
|
|
|
|
|
if (!secondRun&&dir!=BOTH) { |
|
|
|
|
MoveObjectTowardsPoint(obj,targetPos,dir,moveSpd,true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return reachedPosition; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetGameFlag(Flag flag,bool val) { |
|
|
|
|
GAME_FLAGS[flagint(flag)]=val; |
|
|
|
|
} |
|
|
|
|