|
|
|
@ -80,7 +80,7 @@ class Object{ |
|
|
|
|
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.
|
|
|
|
|
//animationSpd is how long to wait before switching frames.
|
|
|
|
|
Object(int id,std::string name,vd2d pos,Animation*spr,vd2d scale={1,1},Pixel color=WHITE,int animationSpd=1) { |
|
|
|
|
Object(int id,std::string name,vd2d pos,Animation*spr,vd2d scale={1,1},Pixel color=WHITE,int animationSpd=1,bool temp=false) { |
|
|
|
|
this->spr=spr; |
|
|
|
|
this->pos=pos; |
|
|
|
|
this->id=id; |
|
|
|
@ -88,6 +88,7 @@ class Object{ |
|
|
|
|
this->color=color; |
|
|
|
|
this->animationSpd=animationSpd; |
|
|
|
|
SetScale(scale); |
|
|
|
|
this->temp=temp; |
|
|
|
|
} |
|
|
|
|
void SetScale(vd2d scale) { |
|
|
|
|
this->scale=scale; |
|
|
|
@ -266,10 +267,21 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
case ActionType::CREATE_OBJECTS:{ |
|
|
|
|
for (auto&obj:((CreateObjects*)CurrentCutscene->GetAction())->GetObjects()) { |
|
|
|
|
obj->temp=true; |
|
|
|
|
AddObjectToWorld(obj); |
|
|
|
|
AddObjectToWorld(CurrentCutscene->AddCutsceneObject(new Object(obj->id,obj->name,obj->pos,obj->spr,obj->scale,obj->color,obj->animationSpd,true))); |
|
|
|
|
} |
|
|
|
|
CurrentCutscene->AdvanceAction(); |
|
|
|
|
}break; |
|
|
|
|
case ActionType::CLEANUP:{ |
|
|
|
|
for (int i=0;i<OBJECTS.size();i++) { |
|
|
|
|
if (OBJECTS[i]->temp) { |
|
|
|
|
OBJECTS.erase(OBJECTS.begin()+i--); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
CurrentCutscene->CleanupCutscene(); |
|
|
|
|
CurrentCutscene->ResetCutscene(); |
|
|
|
|
CurrentCutscene=nullptr; |
|
|
|
|
StartCutscene(TestCutscene); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (GAME_STATE) { |
|
|
|
@ -1209,13 +1221,6 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
Draw({pos.x,pos.y+size.y-1},Pixel(77, 51, 125)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void PlayCutscene(int scene) { |
|
|
|
|
switch (scene) { |
|
|
|
|
case cutscene::TEST_CUTSCENE:{ |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void StartCutscene(Cutscene*cutscene) { |
|
|
|
|
CurrentCutscene=cutscene; |
|
|
|
|
} |
|
|
|
|