parent
64f6b44994
commit
7fd6cf677e
@ -0,0 +1,8 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
struct GameFlags{ |
||||||
|
bool unitMetersGreyedOut=true;//If true, all but health meters show up as dark grey.
|
||||||
|
bool playerInControl=false; |
||||||
|
bool limitedBuildOptions=false; |
||||||
|
bool guideEnabled=true; |
||||||
|
}; |
@ -0,0 +1,7 @@ |
|||||||
|
#pragma once |
||||||
|
#include "MemoryType.h" |
||||||
|
|
||||||
|
struct Memory{ |
||||||
|
MemoryType type; |
||||||
|
int size; |
||||||
|
}; |
@ -1,76 +1,105 @@ |
|||||||
#pragma once |
#pragma once |
||||||
#include "olcUTIL_Camera2D.h" |
#include "olcUTIL_Camera2D.h" |
||||||
#include "Textbox.h" |
#include "Textbox.h" |
||||||
|
#include "Unit.h" |
||||||
|
#include "olcPGEX_AudioSource.h" |
||||||
|
#include "olcPGEX_TransformedView.h" |
||||||
|
#include "GameFlags.h" |
||||||
|
#include "Level.h" |
||||||
|
|
||||||
class Scenario{ |
class Scenario{ |
||||||
public: |
public: |
||||||
Scenario(); |
Scenario(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
virtual~Scenario(); |
virtual~Scenario(); |
||||||
void _Start(); |
void _Start(); |
||||||
|
void Draw(); |
||||||
virtual void Start(); |
virtual void Start(); |
||||||
void _Update(); |
void _Update(); |
||||||
|
bool transitionToNextLevel=false; |
||||||
|
LevelName nextLevel=LevelName::STAGE1; |
||||||
protected: |
protected: |
||||||
|
void DisplayBox(std::string text,bool scaryHoodedFigure=false); |
||||||
|
void SetCameraTarget(vf2d pos); |
||||||
|
void SetObjective(std::string objective); |
||||||
|
virtual bool MissionCompleted(); |
||||||
virtual void Update(); |
virtual void Update(); |
||||||
int state=0; |
int state=0; |
||||||
utils::Camera2D camera; |
utils::Camera2D camera; |
||||||
vf2d targetPos; |
vf2d targetPos; |
||||||
Textbox box; |
Textbox box; |
||||||
float initialWaitTime=3; |
float initialWaitTime=3; |
||||||
|
bool missionCompleted=false; |
||||||
|
float missionFinishWaitTime=3; |
||||||
|
float missionCompletedTimer=0; |
||||||
|
std::vector<std::shared_ptr<Unit>>&units; |
||||||
|
std::vector<std::unique_ptr<Renderable>>&IMAGES; |
||||||
|
std::vector<std::unique_ptr<Audio>>&SOUNDS; |
||||||
|
GameFlags&flags; |
||||||
|
std::string&objective; |
||||||
|
TileTransformedView&game; |
||||||
}; |
}; |
||||||
|
|
||||||
class Stage1:public Scenario{ |
class Stage1:public Scenario{ |
||||||
public: |
public: |
||||||
Stage1(); |
Stage1(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
||||||
class Stage2:public Scenario{ |
class Stage2:public Scenario{ |
||||||
public: |
public: |
||||||
Stage2(); |
Stage2(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
||||||
class Stage3:public Scenario{ |
class Stage3:public Scenario{ |
||||||
public: |
public: |
||||||
Stage3(); |
Stage3(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
||||||
class Stage4:public Scenario{ |
class Stage4:public Scenario{ |
||||||
public: |
public: |
||||||
Stage4(); |
Stage4(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
||||||
class Stage5:public Scenario{ |
class Stage5:public Scenario{ |
||||||
public: |
public: |
||||||
Stage5(); |
Stage5(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
||||||
class Stage6:public Scenario{ |
class Stage6:public Scenario{ |
||||||
public: |
public: |
||||||
Stage6(); |
Stage6(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
||||||
class Stage7:public Scenario{ |
class Stage7:public Scenario{ |
||||||
public: |
public: |
||||||
Stage7(); |
Stage7(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
||||||
class Stage8:public Scenario{ |
class Stage8:public Scenario{ |
||||||
public: |
public: |
||||||
Stage8(); |
Stage8(std::vector<std::shared_ptr<Unit>>&units,std::vector<std::unique_ptr<Renderable>>&IMAGES,std::vector<std::unique_ptr<Audio>>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); |
||||||
protected: |
protected: |
||||||
void Start(); |
void Start(); |
||||||
void Update(); |
void Update(); |
||||||
|
bool MissionCompleted(); |
||||||
}; |
}; |
Loading…
Reference in new issue