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

Vibrate the device on game lost #454

Merged
merged 3 commits into from
May 15, 2019
Merged

Vibrate the device on game lost #454

merged 3 commits into from
May 15, 2019

Conversation

kosamari
Copy link
Contributor

@kosamari kosamari changed the title Vibrate the device on game lost [wip]Vibrate the device on game lost May 13, 2019
@kosamari
Copy link
Contributor Author

I'm going to add vibrate on-off preference in settings menu as well.

@kosamari kosamari changed the title [wip]Vibrate the device on game lost Vibrate the device on game lost May 13, 2019
@kosamari kosamari requested review from jakearchibald and surma and removed request for jakearchibald May 13, 2019 18:14
@kosamari
Copy link
Contributor Author

this partially addresses #453

Copy link
Contributor

@surma surma left a comment

Choose a reason for hiding this comment

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

Some nits, otherwise LGTM.

@@ -186,6 +187,9 @@ export default class Game extends Component<Props, State> {
this._tryAgainBtn
) {
this._tryAgainBtn.focus();
if (this.props.vibrate) {
window.navigator.vibrate(300);
Copy link
Contributor

Choose a reason for hiding this comment

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

Omit window and move 300 to the constants file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@surma did you mean constants file in util or just const within the file??

@@ -47,6 +47,7 @@ export interface Props {
toRevealTotal: number;
useMotion: boolean;
bestTime?: number;
vibrate: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I’d call this useVibration or something in that vein.

@@ -35,6 +35,8 @@ interface Props {
disableAnimationBtn: boolean;
texturePromise: Promise<any>;
supportsSufficientWebGL: boolean;
vibrate: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

@@ -98,6 +98,7 @@ interface State {
motionPreference: boolean;
gameInPlay: boolean;
allowIntroAnim: boolean;
vibrationPreference: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

same.

@kosamari kosamari merged commit 70a4121 into master May 15, 2019
@kosamari kosamari deleted the vibrate-on-lost branch May 15, 2019 01:53
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