immersion_play_effect

Play a haptic effect.

Syntax:

immersion_play_effect(effect);


ArgumentDescription
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.

NameValueNameValue
ALERT163ALERT1072
ALERT264ALERT365
ALERT466ALERT567
ALERT668ALERT769
ALERT870ALERT971
BOUNCE_1009BOUNCE_3311
BOUNCE_6610BUMP_1006
BUMP_338BUMP_667
DOUBLE_BUMP_10018DOUBLE_BUMP_3320
DOUBLE_BUMP_6619DOUBLE_SHARP_CLICK_10012
DOUBLE_SHARP_CLICK_3314DOUBLE_SHARP_CLICK_6613
DOUBLE_STRONG_CLICK_10015DOUBLE_STRONG_CLICK_3317
DOUBLE_STRONG_CLICK_6616ENGINE1_100112
ENGINE1_33114ENGINE1_66113
ENGINE2_100115ENGINE2_33117
ENGINE2_66116ENGINE3_100118
ENGINE3_33120ENGINE3_66119
ENGINE4_100121ENGINE4_33123
ENGINE4_66122EXPLOSION173
EXPLOSION1082EXPLOSION274
EXPLOSION375EXPLOSION476
EXPLOSION577EXPLOSION678
EXPLOSION779EXPLOSION880
EXPLOSION981FAST_PULSE_10045
FAST_PULSE_3347FAST_PULSE_6646
FAST_PULSING_10048FAST_PULSING_3350
FAST_PULSING_6649IMPACT_METAL_10096
IMPACT_METAL_3398IMPACT_METAL_6697
IMPACT_RUBBER_10099IMPACT_RUBBER_33101
IMPACT_RUBBER_66100IMPACT_WOOD_10093
IMPACT_WOOD_3395IMPACT_WOOD_6694
LONG_BUZZ_10027LONG_BUZZ_3329
LONG_BUZZ_6628LONG_TRANSITION_RAMP_DOWN_10039
LONG_TRANSITION_RAMP_DOWN_3341LONG_TRANSITION_RAMP_DOWN_6640
LONG_TRANSITION_RAMP_UP_10033LONG_TRANSITION_RAMP_UP_3335
LONG_TRANSITION_RAMP_UP_6634SHARP_CLICK_1000
SHARP_CLICK_332SHARP_CLICK_661
SHORT_BUZZ_10030SHORT_BUZZ_3332
SHORT_BUZZ_6631SHORT_TRANSITION_RAMP_DOWN_10042
SHORT_TRANSITION_RAMP_DOWN_3344SHORT_TRANSITION_RAMP_DOWN_6643
SHORT_TRANSITION_RAMP_UP_10036SHORT_TRANSITION_RAMP_UP_3338
SHORT_TRANSITION_RAMP_UP_6637SLOW_PULSE_10051
SLOW_PULSE_3353SLOW_PULSE_6652
SLOW_PULSING_10054SLOW_PULSING_3356
SLOW_PULSING_6655STRONG_CLICK_1003
STRONG_CLICK_335STRONG_CLICK_664
TEXTURE1102TEXTURE10111
TEXTURE2103TEXTURE3104
TEXTURE4105TEXTURE5106
TEXTURE6107TEXTURE7108
TEXTURE8109TEXTURE9110
TICK_10024TICK_3326
TICK_6625TRANSITION_BOUNCE_10060
TRANSITION_BOUNCE_3362TRANSITION_BOUNCE_6661
TRANSITION_BUMP_10057TRANSITION_BUMP_3359
TRANSITION_BUMP_6658TRIPLE_STRONG_CLICK_10021
TRIPLE_STRONG_CLICK_3323TRIPLE_STRONG_CLICK_6622
WEAPON183WEAPON1092
WEAPON284WEAPON385
WEAPON486WEAPON587
WEAPON688WEAPON789
WEAPON890WEAPON991


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