Skip to main content

An auto battling Pokémon cli game

Project description

Pokemon YEET

An auto battling Pokémon cli game.

This game was created as part of the 2021 MASTERMND deCoded Journey sofware bootcamp:

  1. creating a Pokemon class (starts at 1:24:48)
  2. making it into a game
  3. using an API

Install

This game is built with Python, which has installation instructions here.

Download the game with pip:

pip install --user -U pokemon-yeet-2ndbillingcycle

Installation error

If pip returns an error like the following:

...
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-h6qzslht/setup.py'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-h6qzslht/

pip is out of date, and needs to be updated:

pip install --user --upgrade pip

Play

With the game installed, run the command pokemon-yeet to play:

$ pokemon-yeet
...
Downloading pokemon #151
Pokemon data downloaded
get ready, now recruiting your team of pokemon!


team selected! meet your new team
omastar: HP: 70 TYPE: rock
nidoking: HP: 81 TYPE: poison
tentacool: HP: 40 TYPE: water


now recruiting the enemy team!


team selected! meet your enemies!
kakuna: HP: 45 TYPE: bug
nidorino: HP: 61 TYPE: poison
venomoth: HP: 70 TYPE: bug
PREPARE TO FIGHT!!!!!
omastar attacked with scratch and it did 35 damage
kakuna: HP: 10 TYPE: bug
kakuna attacked with leer and it did 20 damage
omastar: HP: 50 TYPE: rock
omastar attacked with tackle and it did 10 damage
kakuna: HP: 0 TYPE: bug
kakuna has FAINTED
kakuna: HP: 0 TYPE: bug
THE SCORE IS: ME:1 ENEMY:0
nidoking attacked with cut and it did 25 damage
nidorino: HP: 36 TYPE: poison
nidorino attacked with cut and it did 25 damage
nidoking: HP: 56 TYPE: poison
nidoking attacked with tackle and it did 10 damage
nidorino: HP: 26 TYPE: poison
nidorino attacked with leer and it did 20 damage
nidoking: HP: 36 TYPE: poison
nidoking attacked with cut and it did 25 damage
nidorino: HP: 1 TYPE: poison
nidorino attacked with tackle and it did 10 damage
nidoking: HP: 26 TYPE: poison
nidoking attacked with leer and it did 20 damage
nidorino: HP: -19 TYPE: poison
nidorino has FAINTED
nidorino: HP: -19 TYPE: poison
THE SCORE IS: ME:2 ENEMY:0
tentacool attacked with tackle and it did 10 damage
venomoth: HP: 60 TYPE: bug
venomoth attacked with cut and it did 25 damage
tentacool: HP: 15 TYPE: water
tentacool attacked with leer and it did 20 damage
venomoth: HP: 40 TYPE: bug
venomoth attacked with tackle and it did 10 damage
tentacool: HP: 5 TYPE: water
tentacool attacked with leer and it did 20 damage
venomoth: HP: 20 TYPE: bug
venomoth attacked with leer and it did 20 damage
tentacool: HP: -15 TYPE: water
tentacool has FAINTED
tentacool: HP: -15 TYPE: water
THE SCORE IS: ME:2 ENEMY:1
WE WON HAHAHAHAHAHAHAHAHAHAHAHA

note: running pokemon-yeet will create a directory to store information about Pokémon

Development

This repository can be downloaded with git (a mastermndio video about git). Once that's done, create a virtual environment in the same directory:

python -m venv venv

note: depending on how Python was installed, python may be python3, and venv may need to be downloaded separately (e.g. as python3-venv)

This creates a directory called venv in the current directory.

Then, activate the virtual environment. On Linux, this looks like:

. venv/bin/activate

Make sure pip inside the virtual environment is up to date:

pip install --upgrade pip

Then, install the game in the virtual environment:

pip install ./

And you're ready to go! Change some files, re-install, and run again!

Packaging

Flit is used to package and upload the game.

To upload your own version, change the information in [pyproject.toml][flit pyproject.toml]:

  • dist-name: replace 2ndbillingcycle with your username
  • author: your name
  • author-email: your email
  • home-page: either put the link to your GitHub fork, or remove this line

Then, install Flit and build the distribution files. With the virtual environment activated:

pip install --upgrade flit
python -m flit build

Then, follow the official Python packaging guide for uploading the package to the Test Python Package Index.

Alternatively, you can [create an API token on PyPI with a scope for "Entire account"][api token], and run flit publish, pasting the created API token for the password.

API dependencies

This game uses https://pokeapi.co/ to get information about Pokémon.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pokemon-yeet-2ndbillingcycle-0.0.6.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pokemon_yeet_2ndbillingcycle-0.0.6-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pokemon-yeet-2ndbillingcycle-0.0.6.tar.gz.

File metadata

File hashes

Hashes for pokemon-yeet-2ndbillingcycle-0.0.6.tar.gz
Algorithm Hash digest
SHA256 a8f6a9d8fc3a3138c5821bf0adc7bbdac565e0a7819bf51b6524f7771b8b3f8a
MD5 f114443717df49c766d0da93d7a79317
BLAKE2b-256 25d8dac04ea2b58d690eb2cef4315e30b675ccf3dc5d1d0d7704ed2859a142f8

See more details on using hashes here.

File details

Details for the file pokemon_yeet_2ndbillingcycle-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pokemon_yeet_2ndbillingcycle-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 52e1e405ed76d252de80e873c22bc72b8a05a63dc1b9fe05f41365a11f24714a
MD5 16177d4e02881a8282fe33a58a73a5c8
BLAKE2b-256 d4b81228e69568e659d27aa2138d6344aa688eb4be1316a856ee11d95f4caec3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page