|
|
|
#pragma once
|
|
|
|
#include "VirusAttack.h"
|
|
|
|
#include "olcUTIL_Camera2D.h"
|
|
|
|
|
|
|
|
class Scenario{
|
|
|
|
public:
|
|
|
|
Scenario(VirusAttack*game);
|
|
|
|
virtual void Start();
|
|
|
|
void _Update();
|
|
|
|
virtual void Update()=0;
|
|
|
|
void _Draw();
|
|
|
|
virtual void Draw()=0;
|
|
|
|
void DisplayDialog(std::string dialogText,bool spooky=false);
|
|
|
|
void SetObjective(std::string objective);
|
|
|
|
void SetupCameraTarget(vf2d pos);
|
|
|
|
void MoveCamera();
|
|
|
|
virtual bool MissionCompleted()=0;
|
|
|
|
virtual void NextLevel();
|
|
|
|
protected:
|
|
|
|
VirusAttack*game;
|
|
|
|
int state=0;
|
|
|
|
Textbox dialog;
|
|
|
|
float initialWaitTimer=3;
|
|
|
|
utils::Camera2D camera;
|
|
|
|
vf2d cameraTargetPos={};
|
|
|
|
bool missionCompleted=false;
|
|
|
|
float waitToContinueTimer=0;
|
|
|
|
float missionCompletedTimer=0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SetupStage(StageClass) \
|
|
|
|
class StageClass:public Scenario{ \
|
|
|
|
public: \
|
|
|
|
StageClass(VirusAttack*game); \
|
|
|
|
void Start()override; \
|
|
|
|
void Update()override; \
|
|
|
|
bool MissionCompleted()override; \
|
|
|
|
void Draw()override; \
|
|
|
|
void NextLevel()override; \
|
|
|
|
};
|
|
|
|
|
|
|
|
SetupStage(Stage1)
|
|
|
|
SetupStage(Stage2)
|
|
|
|
SetupStage(Stage3)
|
|
|
|
SetupStage(Stage4)
|
|
|
|
SetupStage(Stage5)
|
|
|
|
SetupStage(Stage6)
|
|
|
|
SetupStage(Stage7)
|
|
|
|
SetupStage(Stage8)
|
|
|
|
|