|
|
|
@ -27,6 +27,8 @@ public: |
|
|
|
|
int textInd=0; |
|
|
|
|
int cursorX=0; |
|
|
|
|
int transitionTime=0; |
|
|
|
|
bool fade=false; |
|
|
|
|
int transparency=0; |
|
|
|
|
int frameCount=0; |
|
|
|
|
float elapsedTime=0; |
|
|
|
|
const float TARGET_RATE = 1/60.0; |
|
|
|
@ -40,6 +42,10 @@ public: |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool GetAnyKey() { |
|
|
|
|
cout << "Something has changed."; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool OnUserUpdate(float fElapsedTime) override |
|
|
|
|
{ |
|
|
|
|
elapsedTime+=fElapsedTime; |
|
|
|
@ -48,9 +54,6 @@ public: |
|
|
|
|
updateGame(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (GetKey(olc::A).bPressed) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
drawGame(); |
|
|
|
|
// called once per frame
|
|
|
|
|
return true; |
|
|
|
@ -58,6 +61,12 @@ public: |
|
|
|
|
|
|
|
|
|
void updateGame(){ |
|
|
|
|
frameCount++; |
|
|
|
|
if (fade&&transparency>0) { |
|
|
|
|
transparency--; |
|
|
|
|
} else |
|
|
|
|
if (!fade&&transparency<255) { |
|
|
|
|
transparency++; |
|
|
|
|
} |
|
|
|
|
switch (GAME_STATE) { |
|
|
|
|
case CUTSCENE_1:{ |
|
|
|
|
if (textInd<STORY_TEXT1.length()) { |
|
|
|
@ -89,6 +98,7 @@ public: |
|
|
|
|
|
|
|
|
|
void drawGame(){ |
|
|
|
|
switch (GAME_STATE) { |
|
|
|
|
FillRectDecal({0,0},{WIDTH,HEIGHT},olc::Pixel(0,0,0,transparency)); |
|
|
|
|
case CUTSCENE_1:{ |
|
|
|
|
DrawStringDecal({16,16},CUTSCENE_CONSOLE_TEXT,olc::GREEN,{1,1}); |
|
|
|
|
if (textInd<STORY_TEXT1.length()) { |
|
|
|
@ -103,6 +113,13 @@ public: |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void fadeOut() { |
|
|
|
|
fade=true; |
|
|
|
|
} |
|
|
|
|
void fadeIn() { |
|
|
|
|
fade=false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|