Skip to content

Commit

Permalink
Add keybinds for save and load actions
Browse files Browse the repository at this point in the history
  • Loading branch information
novosadkry committed Sep 18, 2021
1 parent dab821f commit fcca328
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/Input/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ void Input::HandleEvent(Event& event)
case Keyboard::Escape:
Game::Get().Exit();
break;

case Keyboard::F5:
Level::Save(Game::Get().GetCurrentLevel(), "SAVE.lvl");
break;

case Keyboard::F6:
Game::Get().LoadLevel(Level::From("SAVE.lvl"));
break;
}
} break;

Expand Down
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ int main(int argc, char** argv)
while (game.IsRunning())
game.Tick();

Level::Save(game.GetCurrentLevel(), "SAVE.lvl");

return EXIT_SUCCESS;
}

0 comments on commit fcca328

Please sign in to comment.