immersion_play_effect

Play a haptic effect.

Syntax:

immersion_play_effect(effect);


Argument Description
effect The effect value to use (real).


Returns: N/A


Description

With this function you can play any one of the 123 available haptic effects. Before you can use these effects you must have ticked the "Use Haptics" check-box on the Global Game Settings Android Tab and accepted the Immersion EULA that is shown. Note that some of these effects are repeating or constant and will need to be stopped using the immersion_stop function. A full list of the Immersion effects values are given below, but to get a true feel for what they do and how they will work, it is recommended that you download their test app from Google Play (available here).

NOTE: Using any of the haptic functions without having previously agreed to the EULA will cause your games to fail compiling.

Name Value Name Value
ALERT1 63 ALERT10 72
ALERT2 64 ALERT3 65
ALERT4 66 ALERT5 67
ALERT6 68 ALERT7 69
ALERT8 70 ALERT9 71
BOUNCE_100 9 BOUNCE_33 11
BOUNCE_66 10 BUMP_100 6
BUMP_33 8 BUMP_66 7
DOUBLE_BUMP_100 18 DOUBLE_BUMP_33 20
DOUBLE_BUMP_66 19 DOUBLE_SHARP_CLICK_100 12
DOUBLE_SHARP_CLICK_33 14 DOUBLE_SHARP_CLICK_66 13
DOUBLE_STRONG_CLICK_100 15 DOUBLE_STRONG_CLICK_33 17
DOUBLE_STRONG_CLICK_66 16 ENGINE1_100 112
ENGINE1_33 114 ENGINE1_66 113
ENGINE2_100 115 ENGINE2_33 117
ENGINE2_66 116 ENGINE3_100 118
ENGINE3_33 120 ENGINE3_66 119
ENGINE4_100 121 ENGINE4_33 123
ENGINE4_66 122 EXPLOSION1 73
EXPLOSION10 82 EXPLOSION2 74
EXPLOSION3 75 EXPLOSION4 76
EXPLOSION5 77 EXPLOSION6 78
EXPLOSION7 79 EXPLOSION8 80
EXPLOSION9 81 FAST_PULSE_100 45
FAST_PULSE_33 47 FAST_PULSE_66 46
FAST_PULSING_100 48 FAST_PULSING_33 50
FAST_PULSING_66 49 IMPACT_METAL_100 96
IMPACT_METAL_33 98 IMPACT_METAL_66 97
IMPACT_RUBBER_100 99 IMPACT_RUBBER_33 101
IMPACT_RUBBER_66 100 IMPACT_WOOD_100 93
IMPACT_WOOD_33 95 IMPACT_WOOD_66 94
LONG_BUZZ_100 27 LONG_BUZZ_33 29
LONG_BUZZ_66 28 LONG_TRANSITION_RAMP_DOWN_100 39
LONG_TRANSITION_RAMP_DOWN_33 41 LONG_TRANSITION_RAMP_DOWN_66 40
LONG_TRANSITION_RAMP_UP_100 33 LONG_TRANSITION_RAMP_UP_33 35
LONG_TRANSITION_RAMP_UP_66 34 SHARP_CLICK_100 0
SHARP_CLICK_33 2 SHARP_CLICK_66 1
SHORT_BUZZ_100 30 SHORT_BUZZ_33 32
SHORT_BUZZ_66 31 SHORT_TRANSITION_RAMP_DOWN_100 42
SHORT_TRANSITION_RAMP_DOWN_33 44 SHORT_TRANSITION_RAMP_DOWN_66 43
SHORT_TRANSITION_RAMP_UP_100 36 SHORT_TRANSITION_RAMP_UP_33 38
SHORT_TRANSITION_RAMP_UP_66 37 SLOW_PULSE_100 51
SLOW_PULSE_33 53 SLOW_PULSE_66 52
SLOW_PULSING_100 54 SLOW_PULSING_33 56
SLOW_PULSING_66 55 STRONG_CLICK_100 3
STRONG_CLICK_33 5 STRONG_CLICK_66 4
TEXTURE1 102 TEXTURE10 111
TEXTURE2 103 TEXTURE3 104
TEXTURE4 105 TEXTURE5 106
TEXTURE6 107 TEXTURE7 108
TEXTURE8 109 TEXTURE9 110
TICK_100 24 TICK_33 26
TICK_66 25 TRANSITION_BOUNCE_100 60
TRANSITION_BOUNCE_33 62 TRANSITION_BOUNCE_66 61
TRANSITION_BUMP_100 57 TRANSITION_BUMP_33 59
TRANSITION_BUMP_66 58 TRIPLE_STRONG_CLICK_100 21
TRIPLE_STRONG_CLICK_33 23 TRIPLE_STRONG_CLICK_66 22
WEAPON1 83 WEAPON10 92
WEAPON2 84 WEAPON3 85
WEAPON4 86 WEAPON5 87
WEAPON6 88 WEAPON7 89
WEAPON8 90 WEAPON9 91


Example:

if hp <0
   {
   immersion_play_effect(44);
   }

The above code checks to see if the instance variable "hp" is less than 0 and if it is it plays a haptic effect.


Back: Immersion Haptics
Next: immersion_stop
© Copyright YoYo Games Ltd. 2018 All Rights Reserved