Skip to content
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

Merged
merged 6 commits into from
Feb 13, 2021
Merged

MNG-96 pokemon attack #32

merged 6 commits into from
Feb 13, 2021

Conversation

daria305
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@AleksandraCyp AleksandraCyp left a 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);
Copy link
Collaborator

@AleksandraCyp AleksandraCyp Feb 13, 2021

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?)

Copy link
Collaborator Author

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.

@daria305 daria305 marked this pull request as ready for review February 13, 2021 11:51
@AleksandraCyp AleksandraCyp merged commit 471ef34 into master Feb 13, 2021
@lukaszdutka lukaszdutka deleted the MNG-96-Poke-attack branch February 13, 2021 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants