diff --git a/.gitignore b/.gitignore index cdeca7a..0816680 100644 --- a/.gitignore +++ b/.gitignore @@ -371,6 +371,9 @@ assets/textures/*.txt assets/data/*.json manifest.json +# VS +CMakeSettings.json + # VSCode, clangd etc .vscode/ .cache/ diff --git a/EasyInstall.ps1 b/EasyInstall.ps1 new file mode 100644 index 0000000..5ab8e97 --- /dev/null +++ b/EasyInstall.ps1 @@ -0,0 +1,28 @@ +Write-Host -ForegroundColor Yellow "+++ PKMN Asset Builder +++" + +Write-Host "`nAccording to the National Pok\u00e9mon Index, the first 151 entries served in Generation I." +Write-Host "You may use any of these numbers to create new asset files to play this game.`n" + +$ID1 = Read-Host "Pokemon ID #1" +$ID2 = Read-Host "Pokemon ID #2" + +if ( -not (Test-Path -Path "venv" -PathType Container) ) +{ + Write-Host -ForegroundColor Yellow "Creating a new virtual environment . . ." + python -m venv venv/ + .\venv\Scripts\Activate.ps1 + Write-Host "Installing dependencies . . ." + python -m pip install --upgrade pip + python -m pip install -r requirements.txt --only-binary all +} +else +{ + .\venv\Scripts\Activate.ps1 +} + +python gen_data.py --verbose make --id $ID1 $ID2 +python gen_data.py manifest + +Write-Host -ForegroundColor Yellow "Done!" + +deactivate # virtual environment \ No newline at end of file diff --git a/README.md b/README.md index e5b79d8..5d331e1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,20 @@
-## Build & Debug +## For Users: Playing the Game + +Go to [Releases](https://github.com/cpp-gamedev/pkmn/releases) and download the +latest version of `pkmn-x64-linux-windows-v1.0.0-*.zip`. Unzip this directory, then + +- run `easy_install.sh` (Linux) +- run `EasyInstall.ps1` (Windows) + +to configure the game. This process may take a minute or two depending on your +internet connection. After that, run the `pkmn` binary (`pkmn.exe` on Windows) +to start the game. The game takes up quite a bit of vertical space, so you may +want to adjust the size of your terminal. + +## For Developers: Build & Debug the Game Initialize and update all submodules after you have cloned this repository: @@ -34,12 +47,6 @@ environments on Linux. ### Generating new Pokemon ---- - -*Note: You can also use the `./easy_install.sh` script to skip this section.* - ---- - If this is your first time using a python script, use ```bash diff --git a/easy_install.sh b/easy_install.sh index 3f6e25b..c6d92aa 100644 --- a/easy_install.sh +++ b/easy_install.sh @@ -25,7 +25,6 @@ fi python3 gen_data.py --verbose make --id $id1 $id2 python3 gen_data.py manifest -echo "Updating submodules . . ." -git submodule update --init --recursive - echo "Done!" + +deactivate # virtual environment diff --git a/src/anim.cpp b/src/anim.cpp index c642bc2..fc931d1 100644 --- a/src/anim.cpp +++ b/src/anim.cpp @@ -41,7 +41,7 @@ void print_splash_screen(const std::filesystem::path& assets_dir) std::cout << '\n' << std::setfill(' ') << std::setw(19); - utils::slow_print("copyright (c) 2021 cpp-gamedev", std::chrono::milliseconds{50}); + utils::delayed_print("copyright (c) 2021 cpp-gamedev", std::chrono::milliseconds{50}); } void print_move_table(const models::Pokemon& pkmn) diff --git a/src/main.cpp b/src/main.cpp index 43eb677..e253387 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,22 +20,21 @@ int main() auto pkmns = load_main_menu(manifest); auto& [player, ai] = pkmns; - clear_screen(); while (player.hp > 0 && ai.hp > 0) { + clear_screen(); player.make_move(ai, print_frame(player, ai)); if (ai.hp > 0) { sleep(1000ms); ai.make_move(player, random_range