# How to stop vibrating during gameover?

**URL:** <https://forum.makecode.com/t/how-to-stop-vibrating-during-gameover/5449>\
**Category:** Help\
**Created:** [January 9, 2021, 5:12am UTC](https://forum.makecode.com/t/how-to-stop-vibrating-during-gameover/5449 "2021-01-09T05:12:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiba-jp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shiba-jp/32/2879_2.png) [@shiba-jp](https://forum.makecode.com/u/shiba-jp)\
**Post date:** [January 9, 2021, 5:12am UTC](https://forum.makecode.com/t/how-to-stop-vibrating-during-gameover/5449/1 "2021-01-09T05:12:35Z")

</div>

I’m using ARCADE for MakeCode Arcade.

\< [Kitronik ARCADE for MakeCode Arcade – Kitronik Ltd](https://kitronik.co.uk/products/5311-arcade-for-makecode-arcade)\>

I added a controller extension to the following game, calling the vibration method only when the player hits an enemy or item.

> **[Duck War](https://arcade.makecode.com/15276-94013-49110-17966)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

However, when the game is over, it automatically starts vibrating, and it continues until the player presses A to turn off the dialog.  
I would like to stop this.  
I don’t know how to do this because the vibration on game over is not implemented in ‘main.ts’.  
Does anyone know how to do this?

---

<div class="post-metadata">

**Author:** ![shiba-jp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shiba-jp/32/2879_2.png) [@shiba-jp](https://forum.makecode.com/u/shiba-jp)\
**Post date:** [January 10, 2021, 2:43am UTC](https://forum.makecode.com/t/how-to-stop-vibrating-during-gameover/5449/2 "2021-01-10T02:43:41Z")

</div>

Solved!

When the life reaches zero, it transitions to the game over screen.  
In that case, the specified vibration time was not valid in some cases.  
Changed to vibrate on the collision event only when the life is 1 or more.

before

```auto
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
    otherSprite.startEffect(effects.warmRadial, 100)
    otherSprite.destroy()
    info.changeLifeBy(-1)
     controller.vibrate(20)
})

```

After

```auto
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
    otherSprite.startEffect(effects.warmRadial, 100)
    otherSprite.destroy()
    if (info.life() > 1) {
        controller.vibrate(20)
    }
    info.changeLifeBy(-1)
})

```
