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 to play:

$ pokemon
Creating pokemon directory...
Importing Pokemon....
...

Game is Setup and Ready to begin
get ready, now recruiting your team of pokemon!


team selected! meet your new team
victreebel: HP: 80 TYPE: grass
mr-mime: HP: 40 TYPE: psychic
clefable: HP: 95 TYPE: fairy


now recruiting the enemy team!


team selected! meet your enemies!
doduo: HP: 35 TYPE: normal
nidorina: HP: 70 TYPE: poison
krabby: HP: 30 TYPE: water
PREPARE TO FIGHT!!!!!
victreebel attacked with scratch and it did 35 damage
doduo: HP: 0 TYPE: normal
doduo has FAINTED
doduo: HP: 0 TYPE: normal
THE SCORE IS: ME:1 ENEMY:0
mr-mime attacked with scratch and it did 35 damage
nidorina: HP: 35 TYPE: poison
nidorina attacked with scratch and it did 35 damage
mr-mime: HP: 5 TYPE: psychic
mr-mime attacked with leer and it did 20 damage
nidorina: HP: 15 TYPE: poison
nidorina attacked with cut and it did 25 damage
mr-mime: HP: -20 TYPE: psychic
mr-mime has FAINTED
mr-mime: HP: -20 TYPE: psychic
THE SCORE IS: ME:1 ENEMY:1
clefable attacked with cut and it did 25 damage
krabby: HP: 5 TYPE: water
krabby attacked with scratch and it did 35 damage
clefable: HP: 60 TYPE: fairy
clefable attacked with cut and it did 25 damage
krabby: HP: -20 TYPE: water
krabby has FAINTED
krabby: HP: -20 TYPE: water
THE SCORE IS: ME:2 ENEMY:1
WE WON HAHAHAHAHAHAHAHAHAHAHAHA

note: running pokemon will create a directory called pokemon/ 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.5.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.5-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pokemon-yeet-2ndbillingcycle-0.0.5.tar.gz
Algorithm Hash digest
SHA256 8bb329bed720ef9babdd6d3c80d70bd4e99bbdf5121d5c86b998f3f2b8f22230
MD5 b82a04cfc52845a244483da6e670ec30
BLAKE2b-256 479ad0694d1a2d71e97122d4506119dab78daa17828a952256f45de32c22e617

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pokemon_yeet_2ndbillingcycle-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9c33593dd98cb28c0a6bf57c8768252b3df974e37dac42d39c57de435046fa21
MD5 e99686c7eccd18b27866b75d8859313f
BLAKE2b-256 cf5f5be0bda760f726c3e64996d556d0368e6db07c63df69ba654c3e79aa617b

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