mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kevin Moore
bd5e5918d7
|
6 years ago | |
---|---|---|
.. | ||
lib | 6 years ago | |
web | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
pubspec.lock | 6 years ago | |
pubspec.yaml | 6 years ago |
README.md
A fun game to test your color perception abilities.
Contributed as part of the Flutter Create 5K challenge by Yukkei Choi.
How to play
Tap the unique color block as fast as possible.
Features
- Each round when user taps the unique color block, score will be increased by one.
- Timer: 30 seconds countdown.
- Color difference will be stepwise reduced when user reached a higher score.
- If it is difficult to distinguish the unique color block, user can "SHAKE" the device to shift to another theme color, while the position of the unique color block still keep the same.
- Provide a restart button at the end, user can infinitely play again without relaunching the app.
- After each replay, game board's theme color will be different from the previous play.
- Give user a grade based on the final score:
score range | grade |
---|---|
0 - 9 | Fail |
10 - 19 | D |
20 - 29 | C |
30 - 34 | B |
35 - 39 | B+ |
40 - 44 | A |
45 or above | A+ |
Graphics
- I created all graphics used on the app by using Photoshop.
- Flutter is great and now I'm able to demonstrate my artwork on the app into practice.
Techniques used
- Use stateful widget to run the timer countdown animation.
- Since only 5kb is allowed, the grade is calculated by using math, instead of writing if-else statement.
- Use redux to store the game states:
state | description | data type |
---|---|---|
score | Store the player score | int |
board | Locate the position of unique color block | [[int],[int],...] |
count | Count the no. of replay, for switching the theme color | int |
page | Current page / game status | int |
page | description |
---|---|
-1 | First launch the app, show the welcome screen with instruction |
0 | Game in progress |
1 | Game end, show result |
Limitation
Limited to portrait view.