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-99 & MNG-100 #21

Merged
merged 4 commits into from
Feb 11, 2021
Merged

Conversation

memeraki
Copy link
Collaborator

created menu and back button with options.
Options need to be fixed (now are default).
Animation also should be better ;)

> created menu and back button with options.
Options need to be fixed (now are default).
Animation also needs to look better
Comment on lines 31 to 59
attackButtonOne.addEventListener('click', () => {
console.log('attack One used!');
setTimeout( ()=> {
gameHandler.generateActionButtons(player);
}, 500);
//also change player function
for(let i = 0; i < battleButtons.length; i++) {
battleButtons[i].style.backgroundColor = 'green';
}
});
attackButtonTwo.addEventListener('click', () => {
console.log('attack Two used!');
setTimeout( ()=> {
gameHandler.generateActionButtons(player);
}, 500);
// also change player function
for(let i = 0; i < battleButtons.length; i++) {
battleButtons[i].style.backgroundColor = 'green';
}
});
backButton.addEventListener('click', () => {
//timeout and style for some button animation - the animation needs to be change
setTimeout( ()=> {
gameHandler.generateActionButtons(player);
}, 500);
for(let i = 0; i < battleButtons.length; i++) {
battleButtons[i].style.backgroundColor = 'green';
}
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you think there is some repeated logic, that can be extracted out? :)

Comment on lines 69 to 97
switchButtonOne.addEventListener('click', () => {
console.log('pokemon One gooo!');
setTimeout( ()=> {
gameHandler.generateActionButtons(player);
}, 500);
// also change player function
for(let i = 0; i < battleButtons.length; i++) {
battleButtons[i].style.backgroundColor = 'green';
}
});
switchButtonTwo.addEventListener('click', () => {
console.log('pokemon Two gooo!');
setTimeout( ()=> {
gameHandler.generateActionButtons(player);
}, 500);
// also change player function
for(let i = 0; i < battleButtons.length; i++) {
battleButtons[i].style.backgroundColor = 'green';
}
});
backButton.addEventListener('click', () => {
//timeout and style for some button animation - the animation needs to be change
setTimeout( ()=> {
gameHandler.generateActionButtons(player);
}, 500);
for(let i = 0; i < battleButtons.length; i++) {
battleButtons[i].style.backgroundColor = 'green';
}
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. It might be possible to extract it to one function. As input it could take: 1) button on which the event listener should be added; 2) the function it should call (i.e. eatMango(), switchToPokemon(1) or something)

Copy link
Owner

@lukaszdutka lukaszdutka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm picking on, but it is for your own good 🙃
I am really amazed by the amount of the code you have done here, looks very structured, just as I like!

@AleksandraCyp AleksandraCyp merged commit 05ecc60 into master Feb 11, 2021
@lukaszdutka lukaszdutka deleted the MNG-99&MNG-100-modals-for-action-buttons branch February 12, 2021 06:42
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.

3 participants