Welcome to the Pokemon Text-Based Game! In this adventure-filled journey, you'll embark on a quest to become the ultimate Pokemon trainer. Armed with your wit, strategy, and a trusty team of Pokemon, you'll battle fierce enemies, catch wild creatures, and strive to collect all the badges in the region. This repository contains the implementation of a simple text-based Pokemon game. The game involves battling enemies to win badges and Pokeballs or catching Pokemons using Pokeballs to expand your Pokemon collection.
The repository includes the following four classes:
- Name
- Health Points (HP)
- Attack Value (Atk)
- Constructors:
- Default constructor
- Constructor with name and attack value parameters
- Copy constructor
- Getters for all attributes
- Pokedex Array (Array that holds Pokemon objects)
- Position value
- Constructor(s)
updatePokedex: Method to add new Pokemons to the Pokedex array, checking for duplicatesprintPokedex: Method to print Pokemon names from the Pokedex array
- Name
- Pokemon Number
- Pokeball Number
- Badge Number
- Player’s Pokemon (Object of Pokemon Class)
- Player’s Pokedex (Object with Pokedex Class)
- Constructors
showPokemonNumber: Method to return the number of PokemonsshowPokeballNumber: Method to return the number of PokeballsshowBadgeNumber: Method to return the number of BadgesgetPokemon: Method to return player's Pokemon objectbattleWon: Method to update badge and Pokeball numbers after winning a battlecatchPokemon: Method to update Pokemon and Pokeball numbers after catching a Pokemon
- Name
- Enemy’s Pokemon (Object with Pokemon Class)
- Constructors
getPokemon: Method to return enemy's Pokemon objectgetName: Method to return the name of the enemy
readEnemyNames: Method to read enemy names from a filereadPokemonNames: Method to read Pokemon names from a filecharacterCreate: Method to create a character (player) with chosen name and PokemonfightEnemy: Method for battling an enemycatchPokemon: Method for catching a Pokemon
The game offers the following actions:
- Fight for a badge
- Catch a Pokemon
- Display the number of Pokemons
- Display the number of Pokeballs
- Display the number of Badges
- Display the Pokedex
- Exit the game
Prepare yourself, young trainer, for an epic adventure awaits. The world of Pokemon is vast and full of wonders, waiting for you to explore. So grab your Pokeballs, hone your skills, and embark on a journey that will test your courage, determination, and bond with your Pokemon companions. The path to greatness begins now!
To compile and run the provided code, use the following commands: (make sure that all the files are in the same directory)
g++ -Wall -Werror main.cpp pokemon.cpp pokemon.h -o your_file_name
./your_file_name enemyNames.txt pokemonNames.txt