narenbakshi97/Pokemon-Simulator

Adding Evoluation functionality

オープン

#3 opened on 2021/02/21

 (2 件のコメント) (0 件のリアクション) (1 人の担当者)JavaScript (7 件のフォーク)auto 404
enhancementgood first issue

Repository metrics

Stars
 (2 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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)

コントリビューターガイド