-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNG-96 pokemon attack #32
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Daria, I already created a system that checkes if the pokemon was defeated and forces you to choose a new pokemon and on my current branch, with a lot less lines of code. After it gets merged, please check it out!
Basically, I think that the code you added in the attack function should be enough. You don't have to change anything in buttons!
The only thing regarding buttons that is to be made is desabling them when a given pokemon is dead (but there is a task on trello for that, I think)
animationButtonsEntry(battleButtons); | ||
magicFunction(attackButtonOne, battleButtons, gameHandler, attack); | ||
magicFunction(attackButtonTwo, battleButtons, gameHandler, attack); | ||
magicFunction(attackButtonOne, battleButtons, gameHandler, attack, moveOne); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const pokemon = gameHandler.currentPlayer.getActivePokemon;
const move = pokemon.moves.find(move => move.moveName === e.currentTarget.textContent)
Maybe instead of adding moves to magic funtion and event listeners, you could use the following code in attack function? (pass event as parameter to the attack function?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I used getting move by event.
I will merge it after you pull request will be on master.
No description provided.