From b4e2765f23e368e653790976cf37049418a51c61 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 8 Apr 2023 15:32:44 -0500 Subject: [PATCH] Level loading to file format is now possible. --- Faceball2030/Editor.cpp | 8 ++++++-- Faceball2030/Editor.h | 1 + Faceball2030/assets/map/map1.map | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Faceball2030/Editor.cpp b/Faceball2030/Editor.cpp index e5517a9..b44503f 100644 --- a/Faceball2030/Editor.cpp +++ b/Faceball2030/Editor.cpp @@ -6,14 +6,18 @@ using namespace olc; extern FaceBall* game; void Editor::Update(float fElapsedTime){ - if (!game->IsTextEntryEnabled()){ + LoadLevelHandling(); +} + +void Editor::LoadLevelHandling() { + if (!game->IsTextEntryEnabled()) { if (game->GetKey(F1).bPressed || reEnableTextEntry) { game->TextEntryEnable(true); reEnableTextEntry = false; } } 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 }); } } diff --git a/Faceball2030/Editor.h b/Faceball2030/Editor.h index 171e5f1..5d5200c 100644 --- a/Faceball2030/Editor.h +++ b/Faceball2030/Editor.h @@ -52,4 +52,5 @@ class Editor { void Update(float fElapsedTime); void OnTextEntryComplete(const std::string& sText); void LoadLevel(); + void LoadLevelHandling(); }; \ No newline at end of file diff --git a/Faceball2030/assets/map/map1.map b/Faceball2030/assets/map/map1.map index e69de29..70f56f3 100644 --- a/Faceball2030/assets/map/map1.map +++ b/Faceball2030/assets/map/map1.map @@ -0,0 +1,6 @@ +2 +2 +41126 +41126 +41126 +41126 \ No newline at end of file