fac19 / week10-Chlat

https://lets-go-pokemon-battle.netlify.app/
1 stars 0 forks source link

Different moves each time? #33

Closed Roger-Heathcote closed 4 years ago

Roger-Heathcote commented 4 years ago

Right now each character's move is selected once at the start in createPokeData so players always use the same move. At the risk of revealing my ignorance of Pokemon I assume some of them have more than one move. If so it might be nice if they chose from their full repertoire each round.

You might make PokeData.move an array of moves and then select from them randomly in your button handler e.g.

App.js createPokeData move: data.moves.map( move => move.name ) Buttons.js setPokemonAttack(randomPokemon.move[randInt(randomPokemon.move.length-1)]);

(Untested!!!)