Level loading to file format is now possible.

This commit is contained in:
sigonasr2 2023-04-08 15:32:44 -05:00
parent 6c16121c11
commit b4e2765f23
3 changed files with 13 additions and 2 deletions

View File

@ -6,14 +6,18 @@ using namespace olc;
extern FaceBall* game; extern FaceBall* game;
void Editor::Update(float fElapsedTime){ void Editor::Update(float fElapsedTime){
if (!game->IsTextEntryEnabled()){ LoadLevelHandling();
}
void Editor::LoadLevelHandling() {
if (!game->IsTextEntryEnabled()) {
if (game->GetKey(F1).bPressed || reEnableTextEntry) { if (game->GetKey(F1).bPressed || reEnableTextEntry) {
game->TextEntryEnable(true); game->TextEntryEnable(true);
reEnableTextEntry = false; reEnableTextEntry = false;
} }
} }
else { else {
game->DrawStringDecal({ 0,0 }, "Enter Level (1-30): "+game->TextEntryGetString(), WHITE, {4,4}); game->DrawStringDecal({ 0,0 }, "Enter Level (1-30): " + game->TextEntryGetString(), WHITE, { 4,4 });
} }
} }

View File

@ -52,4 +52,5 @@ class Editor {
void Update(float fElapsedTime); void Update(float fElapsedTime);
void OnTextEntryComplete(const std::string& sText); void OnTextEntryComplete(const std::string& sText);
void LoadLevel(); void LoadLevel();
void LoadLevelHandling();
}; };

View File

@ -0,0 +1,6 @@
2
2
41126
41126
41126
41126