watch_display_text_with_fallback(WATCH_POSITION_BOTTOM, " JACK ", "BLaKJK");\r
}\r
\r
-static void begin_playing(void) {\r
+static void begin_playing(bool tap_control_on) {\r
watch_clear_display();\r
+ if (tap_control_on) {\r
+ watch_set_indicator(WATCH_INDICATOR_SIGNAL);\r
+ }\r
game_state = BJ_PLAYING;\r
reset_hands();\r
// Give player their first 2 cards\r
}\r
}\r
\r
-static void handle_button_presses(bool hit) {\r
+static void handle_button_presses(bool tap_control_on, bool hit) {\r
switch (game_state)\r
{\r
case BJ_TITLE_SCREEN:\r
- begin_playing();\r
+ begin_playing(tap_control_on);\r
break;\r
case BJ_PLAYING:\r
if (hit) {\r
switch (event.event_type) {\r
case EVENT_ACTIVATE:\r
if (state->tap_control_on) {\r
- movement_enable_tap_detection_if_available();\r
+ bool tap_could_enable = movement_enable_tap_detection_if_available();\r
+ if (tap_could_enable) {\r
+ watch_set_indicator(WATCH_INDICATOR_SIGNAL);\r
+ } else {\r
+ state->tap_control_on = false;\r
+ }\r
}\r
break;\r
case EVENT_TICK:\r
break;\r
case EVENT_LIGHT_BUTTON_UP:\r
case EVENT_DOUBLE_TAP:\r
- handle_button_presses(false);\r
+ handle_button_presses(state->tap_control_on, false);\r
case EVENT_LIGHT_BUTTON_DOWN:\r
break;\r
case EVENT_ALARM_BUTTON_UP:\r
case EVENT_SINGLE_TAP:\r
- handle_button_presses(true);\r
+ handle_button_presses(state->tap_control_on, true);\r
break;\r
case EVENT_ALARM_LONG_PRESS:\r
if (game_state == BJ_TITLE_SCREEN) {\r
* BUST: Your score is above 21.\r
* TIE: Your score matches the dealer's final score\r
* \r
+ * On a watch that has the accelerometer, long-pressing the ALARM button will turn on the ability to play by tapping.\r
+ * The SIGNAL indicator will display when tapping is enabled.\r
+ * Tapping once will behave like the ALARM button and hit.\r
+ * Tapping twice behave like the LIGHT button and stand.\r
+ * \r
* | Cards | |\r
* |---------|--------------------------|\r
* | Value |2|3|4|5|6|7|8|9|10|J|Q|K|A|\r