- Properties:
currentRound: Keeps track of the current round number.activePlayer: Stores the player (user or AI) currently taking their turn.gameState: Represents the state of the game (e.g., "playing", "ended").
- Methods:
startGame(): Initiates the game loop and sets up the initial conditions.endTurn(): Handles the end of a player's turn and switches to the next player.checkWinConditions(): Checks if a player has met the conditions for winning the game.handlePlayerAction(): Processes the action taken by a player during their turn.
- Properties:
playerID: Identifies the player (user or AI) in the game.pokémonTeam: Stores the player's selected Pokémon for battle.resources: Represents the resources the player can use to interact with the game.activePokémon: Stores the currently active Pokémon in the battle.
- Methods:
choosePokémon(): Allows the player to select Pokémon from their available pool.placePokémon(): Places the selected Pokémon on the battlefield grid.activateAbility(): Triggers the activation of a Pokémon's ability.earnResources(): Updates the player's resources after each turn.
- Properties:
name: The name of the Pokémon.type: The type of the Pokémon (e.g., fire, water, grass).stats: Contains the stats of the Pokémon (health, attack, defense, etc.).abilities: Lists the abilities the Pokémon possesses.statusEffects: Stores any active status effects on the Pokémon.
- Methods:
useAbility(): Executes the ability of the Pokémon during battles.takeDamage(): Calculates and applies damage to the Pokémon based on battle mechanics.applyStatusEffect(): Applies status effects like poison or paralysis to the Pokémon.
startGameLoop(): Initiates the game loop, manages rounds, and player actions.- Flow:
- Starts with the first player's turn in the first round.
- Loops through players, allowing them to take actions.
- Ends the round and proceeds to the next round.
initiateBattle(): Determines the outcome of battles between Pokémon teams.calculateDamage(): Calculates the damage dealt by an attacker to a defender.applyStatusEffects(): Applies status effects to affected Pokémon.
handleClick(): Manages player interactions with the grid and UI elements.selectPokémon(): Enables players to select Pokémon for their team from the available pool.
activateAbility(): Executes a Pokémon's ability and applies its effects.applyAbilityEffects(): Implements specific effects of different abilities.
updateUI(): Refreshes the user interface to reflect changes in the game state.displayMessage(): Shows notifications or messages to players.
makeDecision(): AI determines actions based on strategy and game state.- Flow:
- Analyzes the current game state and available actions.
- Makes decisions like choosing Pokémon, using abilities, or positioning.
- A structured collection of Pokémon information.
- Properties:
name,type,stats,abilities,sprites, etc.
- Stores available Pokémon for players to choose from in each round.
- Structure:
- Array of Pokémon objects from the Pokémon Data.
- Stores and manages Pokémon sprites and graphical assets used in the game.
- Defines a library of abilities and status effects, along with their effects and triggers.
- Defines game settings, such as round count, time limits per turn, and available Pokémon pool size.