Is there any way to add vibrations in a game ?
Just call:
system.vibrate()
Mostly only works on phones. Tablets don’t have the hardware built in to vibrate the device. iPads and iPod touches will just ignore this, but I’ve had problems on some Android tables with it.
Oh, and you might want to set a flag to bypass it in the Simulator, or you’ll hear an annoying beep in the Simulator whenever you perform the command. Drove me nuts until I figured out it’s Corona’s way of telling me, “expect a vibration here.”
On Android, you’ll need to add the VIBRATE permission to your “build.settings” file as documented via the link below or else it’ll trigger a Lua error/Java exception.
Just call:
system.vibrate()
Mostly only works on phones. Tablets don’t have the hardware built in to vibrate the device. iPads and iPod touches will just ignore this, but I’ve had problems on some Android tables with it.
Oh, and you might want to set a flag to bypass it in the Simulator, or you’ll hear an annoying beep in the Simulator whenever you perform the command. Drove me nuts until I figured out it’s Corona’s way of telling me, “expect a vibration here.”
On Android, you’ll need to add the VIBRATE permission to your “build.settings” file as documented via the link below or else it’ll trigger a Lua error/Java exception.