Transition between dome and main map.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 15972d69b1
commit 1d872ad53a
  1. 25
      SeasonsOfLoneliness.cpp
  2. BIN
      Seasons_of_Loneliness

@ -22,7 +22,8 @@ namespace cutscene{
PAN_DOME,
PAUSE_TO_CUTSCENE_3,
CUTSCENE_4,
TRANSITION_CUTSCENE,
TRANSITION_CUTSCENE, //Exit the dome.
TRANSITION_CUTSCENE_2, //Enter the dome.
NODE_COLLECT_CUTSCENE
};
}
@ -665,8 +666,14 @@ public:
switch (CURRENT_CUTSCENE) {
case cutscene::TRANSITION_CUTSCENE:{
LoadMap("assets/maps/map1");
PLAYER_COORDS[0]=40;
PLAYER_COORDS[1]=37;
PLAYER_COORDS[0]=40.5;
PLAYER_COORDS[1]=37.5;
fadeIn();
EndCutscene();
}break;
case cutscene::TRANSITION_CUTSCENE_2:{
LoadMap("assets/maps/map2");
TeleportToMapFileCoords(8,17);
fadeIn();
EndCutscene();
}break;
@ -814,10 +821,14 @@ public:
OBJECTS.erase(OBJECTS.begin()+i--);
performCropUpdate(8);
displayPowerInfo(SNOWSTORM);
}
} else
if (obj.name.compare("EXIT")==0&&collidesWithPlayer(obj)) {
fadeOut();
PlayCutscene(cutscene::TRANSITION_CUTSCENE);
} else
if (obj.name.compare("DOME")==0&&collidesWithPlayer(obj)) {
fadeOut();
PlayCutscene(cutscene::TRANSITION_CUTSCENE_2);
}
}
@ -1730,6 +1741,12 @@ public:
float range(float val1,float val2) {
return random(val2-val1)+val1;
}
//Basically, click on a spot in the text editor and this function translates it into the proper teleport coords so you don't have to.
void TeleportToMapFileCoords(int ln,int col) {
PLAYER_COORDS[0]=col-1+0.5;
PLAYER_COORDS[1]=ln-3+0.5;
}
};

Binary file not shown.
Loading…
Cancel
Save