Prechádzať zdrojové kódy

Add haptic feedback on power up pick up

SimplyMinimal 2 rokov pred
rodič
commit
96e7a6b041
1 zmenil súbory, kde vykonal 14 pridanie a 0 odobranie
  1. 14 0
      app.c

+ 14 - 0
app.c

@@ -168,6 +168,17 @@ const NotificationSequence sequence_bullet_fired = {
     NULL,
 };
 
+const NotificationSequence sequence_powerup_collected = {
+    &message_vibro_on,
+    &message_delay_1,
+    &message_delay_1,
+    &message_delay_1,
+    &message_delay_1,
+    &message_delay_1,
+    &message_vibro_off,
+    NULL,
+};
+
 const NotificationSequence sequence_nuke = {
     &message_blink_set_color_red,
     &message_blink_start_100,
@@ -801,6 +812,9 @@ void powerUp_was_hit(AsteroidsApp* app, int id) {
     PowerUp* p = &app->powerUps[id];
     if(p->display_ttl == 0) return; // Don't collect if already collected or expired
 
+    // Vibrate to indicate power up was collected
+    notification_message(furi_record_open(RECORD_NOTIFICATION), &sequence_powerup_collected);
+
     switch(p->powerUpType) {
     case PowerUpTypeLife:
         if(app->lives < MAXLIVES) app->lives++;