Level loading to file format is now possible.

linux_template
sigonasr2 2 years ago
parent 6c16121c11
commit b4e2765f23
  1. 8
      Faceball2030/Editor.cpp
  2. 1
      Faceball2030/Editor.h
  3. 6
      Faceball2030/assets/map/map1.map

@ -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 });
} }
} }

@ -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();
}; };

@ -0,0 +1,6 @@
2
2
41126
41126
41126
41126
Loading…
Cancel
Save