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

Create Settings Page & How to Play Page, Implement Difficulty Levels #21

Merged
merged 15 commits into from Apr 8, 2022

Conversation

fredy20501
Copy link
Owner

@fredy20501 fredy20501 commented Apr 4, 2022

Settings Page

  • Created the settings page, where you can change volume settings & clear your high scores.
  • When you change the volume it plays a sound so you know how loud it is with the new volume.
  • The settings are saved into shared preferences using the LocalData class.

How to Play Page

  • Created the How to Play page.
  • The practice buttons start the practice mode that Carter had created.
  • The rotation instructions are now separate practice modes, since that made more sense after designing the UI for it.
  • Fixed the swipe instruction's practice mode not correctly looping through the opposite vs normal type of swipe (i.e., previously the opposite swipes were still random in practice mode).

Difficulty Levels

  • Changed the time/music scaling to work linearly.
    • After testing with different curves it just felt weird for it to speed up faster and faster or slower and slower as the game progressed. Linear progression felt much nicer.
  • Added the function getMinDuration() for each instruction that returns the absolute minimum amount of time that users will get for this instruction.
    • I picked the duration for each instruction such that I had just enough time to complete them consistently but couldn't afford to make any mistakes.
  • Added parameters to the difficulty levels that determine how the time scaling works based on the difficulty.
    • extraDuration indicates the amount of extra time that you start with (this is what gets reduced as your score increases). This is added to each instruction's minimum duration.
    • maxLevel indicates at what level do we reach the maximum speed (i.e., at that level the extraDuration is now 0, so you only have the minimum amount of time for each instruction). This relates to how fast the game speeds up.
  • The music scales linearly with the maxLevel. It always starts at 1x and goes up to a maximum of 1.5x when the maxLevel is reached.

Other Stuff

  • Fixed some issues in the game activity (sometimes the instructions got triggered twice and/or crashed)
    • If you closed the activity using the back button just before the gameLoop gets triggered for the next instruction, the instruction is disabled in onPause(), but gets re-enabled by the gameLoop before it has time to call onDestroy(). This kept some sensors enabled, which caused instructions to trigger twice when starting a new game and crash the app.
  • The game mode & difficulty selection is now saved into local storage.
  • Changed the sound effects (score, lose, voice lines) to use SoundPool instead of MediaPlayer.

Demo

Demo showing the new settings & how to play pages:
https://user-images.githubusercontent.com/43451024/161648566-384347ae-7caa-4b35-b945-fefbf64c812c.mp4

@fredy20501 fredy20501 self-assigned this Apr 4, 2022
- Decrease delay for all sensors (more responsive).
- Custom base duration for all instructions.
- Update difficulty descriptions.
- Change timer/music scaling to linear.
@fredy20501 fredy20501 changed the title Create Settings Page & How to Play Page Create Settings Page & How to Play Page, Implement Difficulty Levels Apr 5, 2022
Copy link
Collaborator

@hsavoie hsavoie left a comment

Choose a reason for hiding this comment

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

Ahhhh-mazing 🥇🎆😄👍

@fredy20501 fredy20501 merged commit d61d2da into main Apr 8, 2022
@fredy20501 fredy20501 deleted the extra-ui branch April 8, 2022 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants