narenbakshi97/Pokemon-Simulator

Adding Evoluation functionality

Aperta

#3 aperta il 21 feb 2021

 (2 commenti) (0 reazioni) (1 assegnatario)JavaScript (7 fork)auto 404
enhancementgood first issue

Metriche repository

Star
 (2 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Using the PokeAPI we need to fetch the level number at which our pokemon is leveling up and when it hits the level, a prompt should appear on the screen to ask whether we want to evolve it or not.

Possible steps:

  • Fetch the level and store it in our pokemon object, something like mypokemon[0].evolvesAt = FetchedIntegerValue
  • Create a function that will trigger every time a pokemon levels up, so not all the time but only when it gathers that much exp to go in the next level
  • create a prompt to ask for the user's choice and if yes => set the ID to the newer one (generally ID+1)

Helpful things to take a look at

  • PokeAPI structure to fetch the JSON data (through XHTTP request in JavaScript)

Guida contributor