-
Notifications
You must be signed in to change notification settings - Fork 125
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
Conversation
I'm going to add vibrate on-off preference in settings menu as well. |
this partially addresses #453 |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same.
https://twitter.com/hashseed/status/1127875233531289600