Level loading to file format is now possible.
This commit is contained in:
parent
6c16121c11
commit
b4e2765f23
@ -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…
x
Reference in New Issue
Block a user