youvsvirus / youvsvirus-unity

Unity version of the you vs virus game.
GNU General Public License v3.0
1 stars 1 forks source link

Johannes/#144 keyboard navigation - WIP #147

Closed holke closed 4 years ago

holke commented 4 years ago

This is still work in progress, but i want you to have a look at this.

Complete redesign of our way to handle buttons.

Please have a look and tell me: Do you like the way this works with the keyboard and mouse input?

If you want to change how the buttons are animated, we are free to do nearly everything. The current way was just how i thought would look and feel good.

Also, please try to use the prefab by making a Menu with buttons (for example in the supermarket level the success canvas). You need to:

  1. Copy the prefab to the Canvas
  2. Decide how many buttons you need and copy the single MenuButton as often.
  3. Select the MenuButtonController. Here you need to enter the number of buttons and plug the Buttons into the array.
  4. For each button set its Text and Mouse over text (can be empty).
  5. For each button select the AnimatedPart and under Click Action (Script) select the desired behaviour. (Note: CONTINUE unpauses the game, not continuing to the next level, this is NEXT_LEVEL).
  6. Enjoy your cool menu :)

If you need an action for a button that is not implemented, feel free to add it to the ClickAction script. But why are all actions in one file, i hear you asking? Well, let me walk you through the process of changing the function that is called when the button is clicked and then you may see that it is best not to change it (though you can if you need to):

  1. Select Window->Animation->Animator and Animation
  2. Select the Button
  3. Go to the Animation Window and Click on the ButtonIsClicked Animation
  4. Go to the animator window and look for the little White Rectangle in the time line
  5. Click it
  6. Now you can pull a script to the slot you see and choose a function name.

See, thats tedious ;)

Open Issue:

If we pause the game, the buttons dont work. DANG! This is due to the animations stopping when the game is paused. We need a way to continue the animations.

By the way: This is also linked to #87 since i found out that you can Implement a LoadNextLevel functionality. It requires the levels in the Build Settings to be in the correct order. Thus, when we use these buttons all over the game, we will need to change the order appropriately.

holke commented 4 years ago

By the way. Now that the buttons are animated, it kind of fells like they also should make sounds when selected. A kind of brief blubb.

holke commented 4 years ago

Another issue: When the game ends and we are in a menu but still see the player on the map, controlling the menu with the arrow keys also controls the player. This will probably change when the player is displayed on the canvas anyway?

maccxs commented 4 years ago

Another issue: When the game ends and we are in a menu but still see the player on the map, controlling the menu with the arrow keys also controls the player. This will probably change when the player is displayed on the canvas anyway?

Yes, the player is not allowed to move anymore.

maccxs commented 4 years ago

Had a first look at it and I like it!!! First issue: If I use the arrow keys, this not always changes the button, e.g. if I do it very quickly.

holke commented 4 years ago

That was intended. There is a cool down time in between choosing the buttons, so that it is not instantly. We can reduce this time if you think it is too long.

holke commented 4 years ago

Solved the issue with pausing the game. The buttons now also work in Pause mode.

maccxs commented 4 years ago

With your new-found animation wisdom: Can you make the player house in levelgethome/leveldemo or the supermarkets/hospital wobble a little initially so that they can be easily found on the screen?

holke commented 4 years ago

Of course I can :-) Will make a new issue for this.

maccxs commented 4 years ago

Of course I can :-) Will make a new issue for this.

I love it already. IMHO this should only be animated briefly at the beginning of the level. So it catches your eye.

holke commented 4 years ago

Having lots of ideas already... See #150 for the issue.

holke commented 4 years ago

All Scenes now have the new buttons.

Integrated the new scenes.

A button for the control menu is still todo.

holke commented 4 years ago

Added the new help screen.

This is now ready for review.

I know its annoying: But its important to check that every button does what its supposed to do.

holke commented 4 years ago

Ok, now that we can control everything with the keyboard it feels really weird that the sliders for the sandbox mode have to be controlled with the mouse... I think i have to do somethng about that...

maccxs commented 4 years ago

Hi, you already now that I like these animation :-) It is really cool and it's great that don't need the mouse.

maccxs commented 4 years ago

The time it takes before I can move from on button to the next is too long for me. I now it is intended but it feels like it is not working properly - and this is not what we want. So maybe make it shorter.

maccxs commented 4 years ago

In Main Menu: Make sure that all button have same y-distance from each other.

maccxs commented 4 years ago

Probably the youvsvirus-text should be same y-height as Controls-Button

maccxs commented 4 years ago

Emojis in ExplainScreenCampaing should also have same distance from each other as should the lines of texts next to emojis. Rather a little more distance than there is at the moment. And for this maby set the white text a little higher.

maccxs commented 4 years ago

The sliders in Explort at least for number of people do not work anymore. I am not 100% sure they worked before. But now 100%that they are not

maccxs commented 4 years ago

Maybe we should have two button now at the end of sanbox: Main Menu and Retry. Retry would go directly to the sliders

maccxs commented 4 years ago

Main Menu Button in levelcollectmasks not working correctly

maccxs commented 4 years ago

I think all the other buttons are working properly

holke commented 4 years ago

Unintentionally closed the PR instead of removing a comment from me. sorry.

holke commented 4 years ago

Thanks for the feedback, i will have a look at it.

holke commented 4 years ago

Fixed the menu button in gethome.

Changed the speed of keyboard input. If i make it even faster, i often jump 2 buttons with 1 press which i don't like. So this is i think the fastest possible.

holke commented 4 years ago

I am marking your comments with 👍 if i resolved them, mostly just for me to keep the an overview.

holke commented 4 years ago

yes the sliders do not work anymore. I know why and will fix this.

holke commented 4 years ago

Sliders are working now and the buttons Are aligned. I think this is finally done.

maccxs commented 4 years ago

Changed the main menu screen text and button alignemned @holke: feedback if you are not satisfied

maccxs commented 4 years ago

Contine of levelgethome goes to endscreen sandbox

maccxs commented 4 years ago

the contiune which should lead to leveldisco goes to screen titled "End of mask". This really seems to be mixed up.

maccxs commented 4 years ago

can be merged

holke commented 4 years ago

Currently in the process of merging master into this branch. Some things stopped working (like the smiley status on the canvas when the game is lost). Need to look deeper into this.

holke commented 4 years ago

Ok, made a stupid mistake. Will have to merge again.