generated from sigonasr2/CPlusPlusProjectTemplate
Game is complete\! (Mostly\!)
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
1816449d4d
commit
153b5f3c44
@ -24,7 +24,7 @@ using namespace olc;
|
||||
|
||||
#define STARTING_MAP MAP_1
|
||||
#define STARTING_STATE CUTSCENE_3
|
||||
#define MOVE_SPD 0.075
|
||||
#define MOVE_SPD 0.2
|
||||
#define PLAYER_X 14
|
||||
#define PLAYER_Y 4
|
||||
|
||||
@ -1136,60 +1136,60 @@ public:
|
||||
COLLECTED_ITEMS.push_back({19,5});
|
||||
COLLECTED_ITEMS.push_back({19,6});
|
||||
|
||||
ENCOUNTER_SPIDEY_1.entities.push_back(new Entity(SPIDEY_DECAL,"Spidey",2,3,80,80,MOVESET_SPIDEY));
|
||||
ENCOUNTER_SPIDEY_1.entities.push_back(new Entity(SPIDEY_DECAL,"Spidey",4,4,80,80,MOVESET_SPIDEY));
|
||||
ENCOUNTER_SPIDEY_1.entities.push_back(new Entity(SPIDEY_DECAL,"Spidey",6,2,80,80,MOVESET_SPIDEY));
|
||||
ENCOUNTER_SPIDEY_1.entities.push_back(new Entity(SPIDEY_DECAL,"Spidey",2,3,1,1,MOVESET_SPIDEY));
|
||||
ENCOUNTER_SPIDEY_1.entities.push_back(new Entity(SPIDEY_DECAL,"Spidey",4,4,1,1,MOVESET_SPIDEY));
|
||||
ENCOUNTER_SPIDEY_1.entities.push_back(new Entity(SPIDEY_DECAL,"Spidey",6,2,1,1,MOVESET_SPIDEY));
|
||||
ENCOUNTER_SPIDEY_1.x=79;
|
||||
ENCOUNTER_SPIDEY_1.y=47;
|
||||
ENCOUNTER_SPIDEY_1.playerX=4;
|
||||
ENCOUNTER_SPIDEY_1.playerY=3;
|
||||
ENCOUNTER_SPIDEY_1.map=MAP_1;
|
||||
ENCOUNTERS.push_back(ENCOUNTER_SPIDEY_1);
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X_X",3,2.5,590,590,MOVESET_X_X,{2,2},true));
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X Minion",1,4,0,80,MOVESET_XMINION,{0.7,0.7}));
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X Minion",0,2,0,80,MOVESET_XMINION,{0.7,0.7}));
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X Minion",4,2,0,80,MOVESET_XMINION,{0.7,0.7}));
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X_X",3,2.5,1,1,MOVESET_X_X,{2,2},true));
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X Minion",1,4,1,1,MOVESET_XMINION,{0.7,0.7}));
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X Minion",0,2,1,1,MOVESET_XMINION,{0.7,0.7}));
|
||||
ENCOUNTER_X_X.entities.push_back(new Entity(X_X_DECAL,"X Minion",4,2,1,1,MOVESET_XMINION,{0.7,0.7}));
|
||||
ENCOUNTER_X_X.x=38;
|
||||
ENCOUNTER_X_X.y=35;
|
||||
ENCOUNTER_X_X.playerX=3;
|
||||
ENCOUNTER_X_X.playerY=2;
|
||||
ENCOUNTER_X_X.map=MAP_1;
|
||||
ENCOUNTER_SANDWORM_1.entities.push_back(new Entity(SANDWORM_DECAL,"Sandworm",3,4,165,165,MOVESET_SANDWORM));
|
||||
ENCOUNTER_SANDWORM_1.entities.push_back(new Entity(SANDWORM_DECAL,"Sandworm",6,3,165,165,MOVESET_SANDWORM));
|
||||
ENCOUNTER_SANDWORM_1.entities.push_back(new Entity(SANDWORM_DECAL,"Sandworm",3,4,1,1,MOVESET_SANDWORM));
|
||||
ENCOUNTER_SANDWORM_1.entities.push_back(new Entity(SANDWORM_DECAL,"Sandworm",6,3,1,1,MOVESET_SANDWORM));
|
||||
ENCOUNTER_SANDWORM_1.x=20-4;
|
||||
ENCOUNTER_SANDWORM_1.y=73-3.5;
|
||||
ENCOUNTER_SANDWORM_1.playerX=4;
|
||||
ENCOUNTER_SANDWORM_1.playerY=3.5;
|
||||
ENCOUNTER_SANDWORM_1.map=MAP_3;
|
||||
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Megamoth",3.5,1.75,745,745,MOVESET_MEGAMOTH,{2,2},true));
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",2,1,0,120,MOVESET_MOTH));
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",6,1,0,120,MOVESET_MOTH));
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",4,4,0,120,MOVESET_MOTH));
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Megamoth",3.5,1.75,1,1,MOVESET_MEGAMOTH,{2,2},true));
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",2,1,1,1,MOVESET_MOTH));
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",6,1,1,1,MOVESET_MOTH));
|
||||
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",4,4,1,1,MOVESET_MOTH));
|
||||
ENCOUNTER_MEGAMOTH.x=195-4;
|
||||
ENCOUNTER_MEGAMOTH.y=56-3.5;
|
||||
ENCOUNTER_MEGAMOTH.playerX=4;
|
||||
ENCOUNTER_MEGAMOTH.playerY=0.5;
|
||||
ENCOUNTER_MEGAMOTH.map=MAP_4;
|
||||
ENCOUNTERS.push_back(ENCOUNTER_MEGAMOTH);
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",1,1,225,225,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",3,2,0,225,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Sidewinder",4,3,0,1065,MOVESET_SIDEWINDER,{2,2},true));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",5,3,225,225,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",6,1,0,225,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",1,1,1,1,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",3,2,1,1,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Sidewinder",4,3,1,1,MOVESET_SIDEWINDER,{2,2},true));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",5,3,1,1,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",6,1,1,1,MOVESET_SNAKE));
|
||||
ENCOUNTER_SNAKEPACK.x=11-4;
|
||||
ENCOUNTER_SNAKEPACK.y=5-3.5;
|
||||
ENCOUNTER_SNAKEPACK.playerX=4;
|
||||
ENCOUNTER_SNAKEPACK.playerY=6;
|
||||
ENCOUNTER_SNAKEPACK.map=MAP_5;
|
||||
ENCOUNTERS.push_back(ENCOUNTER_SNAKEPACK);
|
||||
ENCOUNTER_Y_Y.entities.push_back(new Entity(Y_Y_DECAL,"Y.Y",4-1,3.5-2,895,895,MOVESET_Y_Y,{1,1},true));
|
||||
ENCOUNTER_Y_Y.entities.push_back(new Entity(Y_Y_DECAL,"Y.Y",4-1,3.5-2,1,1,MOVESET_Y_Y,{1,1},true));
|
||||
ENCOUNTER_Y_Y.x=1000-4;
|
||||
ENCOUNTER_Y_Y.y=1000-3.5;
|
||||
ENCOUNTER_Y_Y.playerX=4;
|
||||
ENCOUNTER_Y_Y.playerY=6;
|
||||
ENCOUNTER_Y_Y.map=MAP_6;
|
||||
ENCOUNTER_A_A.entities.push_back(new Entity(A_A_DECAL,"A.A",4-2,0,4096,4096,MOVESET_A_A,{2,2},true));
|
||||
ENCOUNTER_A_A.entities.push_back(new Entity(A_A_DECAL,"A.A",4-2,0,1,1,MOVESET_A_A,{2,2},true));
|
||||
ENCOUNTER_A_A.x=1000-4;
|
||||
ENCOUNTER_A_A.y=1000-3.5;
|
||||
ENCOUNTER_A_A.playerX=4;
|
||||
@ -1706,7 +1706,7 @@ public:
|
||||
fadeOutCompleted();
|
||||
playMusic(&SONG_DOME,true,0.4);
|
||||
} else
|
||||
if (!GAME_FLAGS[gameflag::CHECK_ROVER]&&GAME_FLAGS[gameflag::TUTORIAL2_X_X]) {
|
||||
if (!GAME_FLAGS[gameflag::CHECK_ROVER]&&GAME_FLAGS[gameflag::FIRST_ENCOUNTER_X_X]) {
|
||||
GAME_FLAGS[gameflag::CHECK_ROVER]=true;
|
||||
DisplayMessageBox(26);
|
||||
}
|
||||
@ -1738,14 +1738,17 @@ public:
|
||||
}break;
|
||||
case cutscene::STORY_REVIEW:{
|
||||
GAME_STATE=DISPLAY_BOOK;
|
||||
playMusic(&SONG_MAIN,true,0.95);
|
||||
fadeIn();
|
||||
PlayCutscene(cutscene::STORY_REVIEW2);
|
||||
}break;
|
||||
case cutscene::STORY_REVIEW2:{
|
||||
GAME_STATE=GAMEWORLD;
|
||||
LoadMap(MAP_5);
|
||||
GAME_FLAGS[gameflag::NEXT_COORDS2]=true;
|
||||
LoadMap(MAP_2);
|
||||
updatePlayerState();
|
||||
StartCutscene(cutscene::FINAL_REVIEW);
|
||||
playMusic(&SONG_EXPLORE);
|
||||
fadeIn();
|
||||
}break;
|
||||
case cutscene::PREPARE_SEQUENCE:{
|
||||
@ -1998,103 +2001,103 @@ public:
|
||||
for (int i=0;i<OBJECTS.size();i++) {
|
||||
Object*obj = OBJECTS[i];
|
||||
if (obj->name.compare("HAILSTORM_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
HAILSTORM->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased HAILSTORM power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(HAILSTORM);
|
||||
} else
|
||||
if (obj->name.compare("HURRICANE_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
HURRICANE->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased HURRICANE power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(HURRICANE);
|
||||
} else
|
||||
if (obj->name.compare("METEORSHOWER_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
METEOR_RAIN->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased METEORSHOWER power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(METEOR_RAIN);
|
||||
} else
|
||||
if (obj->name.compare("METEORSTORM_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
METEOR_STORM->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased METEORSTORM power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(METEOR_STORM);
|
||||
} else
|
||||
if (obj->name.compare("SNOWSTORM_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
SNOWSTORM->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased SNOWSTORM power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(SNOWSTORM);
|
||||
} else
|
||||
if (obj->name.compare("PETALSTORM_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
PETAL_STORM->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased PETALSTORM power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(PETAL_STORM);
|
||||
} else
|
||||
if (obj->name.compare("SUNNYDAY_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
SUNNY_DAY->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased SUNNYDAY power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(SUNNY_DAY);
|
||||
} else
|
||||
if (obj->name.compare("FLASHFLOOD_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
FLASH_FLOOD->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased FLASHFLOOD power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(FLASH_FLOOD);
|
||||
} else
|
||||
if (obj->name.compare("FIRESTORM_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
FIRESTORM->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased FIRESTORM power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(FIRESTORM);
|
||||
} else
|
||||
if (obj->name.compare("SOLARFLARE_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
int amountGained=rand()%2+5;
|
||||
SOLAR_FLARE->playerOwnCount+=amountGained;
|
||||
std::cout<<"Increased SOLARFLARE power inventory count by "<<amountGained<<".\n";
|
||||
COLLECTED_ITEMS.push_back({(int)obj->x,(int)obj->y});
|
||||
OBJECTS.erase(OBJECTS.begin()+i--);
|
||||
delete obj;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
displayPowerInfo(SOLAR_FLARE);
|
||||
} else
|
||||
if (obj->name.compare("SILICON_PIECE")==0&&collidesWithPlayer(obj)) {
|
||||
@ -2550,6 +2553,7 @@ public:
|
||||
GAME_FLAGS[gameflag::DEFEATED_Y_Y]=true;
|
||||
queueBGMPlayback=false;
|
||||
stopMusic();
|
||||
fadeIn();
|
||||
DisplayMessageBox(58);
|
||||
StartCutscene(cutscene::A_A_ENCOUNTER);
|
||||
SHIP_COLOR=Pixel(89, 55, 36,255);
|
||||
@ -2578,7 +2582,7 @@ public:
|
||||
resetBattleState();
|
||||
PLAYER_COORDS[0]=BATTLE_PLAYER_COORDS.x;
|
||||
PLAYER_COORDS[1]=BATTLE_PLAYER_COORDS.y;
|
||||
performCropUpdate(8);
|
||||
performCropUpdate(48);
|
||||
if (FOOD_REGEN_TURNS>0) {
|
||||
FOOD_REGEN_TURNS=0;
|
||||
foodCount++;
|
||||
@ -2981,8 +2985,6 @@ public:
|
||||
CUTSCENE_FLAGS[0]=true;
|
||||
DisplayMessageBox(45);
|
||||
} else {
|
||||
PLAYER_COORDS[0]=CUTSCENE_OBJS[0]->x;
|
||||
PLAYER_COORDS[1]=CUTSCENE_OBJS[0]->y;
|
||||
current_playerAnim=playerAnimLeft;
|
||||
EndCutscene();
|
||||
}
|
||||
@ -3010,7 +3012,7 @@ public:
|
||||
case cutscene::LAUNCHPAD_OPEN:{
|
||||
if (MoveCameraTowardsPoint({30,35})) {
|
||||
if (!CUTSCENE_FLAGS[0]) {
|
||||
PlaySound(&SOUND_SAW,0.3);
|
||||
PlaySound(&SOUND_SAW,false,0.3);
|
||||
CUTSCENE_FLAGS[0]=true;
|
||||
stopMusic();
|
||||
}
|
||||
@ -3340,6 +3342,7 @@ public:
|
||||
if (!GAME_FLAGS[gameflag::INTRUDER_DETECTED]) {
|
||||
GAME_FLAGS[gameflag::INTRUDER_DETECTED]=true;
|
||||
DisplayMessageBox(53);
|
||||
stopMusic();
|
||||
PlayCutscene(cutscene::INTRUDERS_DETECTED);
|
||||
}
|
||||
}
|
||||
@ -3857,7 +3860,9 @@ public:
|
||||
audioFade=false;
|
||||
}
|
||||
sound::PlayingWave playMusic(sound::Wave*sound,bool loop=true,float spd=1) {
|
||||
audioFadeIn();
|
||||
if (!queueBGMPlayback) {
|
||||
audioFadeIn();
|
||||
}
|
||||
if (SOUND_IS_PLAYING) {
|
||||
stopMusic();
|
||||
}
|
||||
@ -3866,7 +3871,9 @@ public:
|
||||
return CURRENT_BGM;
|
||||
}
|
||||
void PlaySound(sound::Wave* sound,bool loop=false,float spd=1) {
|
||||
audioFadeIn();
|
||||
if (!queueBGMPlayback) {
|
||||
audioFadeIn();
|
||||
}
|
||||
if (LAST_FRAME_SOUND_PLAYED!=frameCount) {
|
||||
engine.PlayWaveform(sound,loop,spd);
|
||||
LAST_FRAME_SOUND_PLAYED=frameCount;
|
||||
@ -3888,7 +3895,7 @@ public:
|
||||
}
|
||||
|
||||
void DisplayMessageBox(int dialogNumber) {
|
||||
performCropUpdate(10);
|
||||
performCropUpdate(48);
|
||||
messageBoxVisible=true;
|
||||
messageBoxCursor=0;
|
||||
std::string split1=STORY_DIALOG[dialogNumber].substr(0,STORY_DIALOG[dialogNumber].find('\n')); //Unused for now.
|
||||
@ -4261,7 +4268,7 @@ public:
|
||||
void displayPowerInfo(WEATHER_POWER*POWER){
|
||||
PlayCutscene(cutscene::NODE_COLLECT_CUTSCENE);
|
||||
CUTSCENE_DISPLAYED_CARD=POWER;
|
||||
PlaySound(&SOUND_SELECT,0.9);
|
||||
PlaySound(&SOUND_SELECT,false,0.9);
|
||||
}
|
||||
|
||||
void applyPixelEffect(ParticleEffect*effect,vf2d pos,float startingTransparency) {
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user