Initial support for "haptic" (force feedback) devices.
[supertux.git] / src / object / player.cpp
index 3cc8a3c..8d771a4 100644 (file)
@@ -20,6 +20,7 @@
 #include "audio/sound_manager.hpp"
 #include "badguy/badguy.hpp"
 #include "control/joystickkeyboardcontroller.hpp"
+#include "control/haptic_manager.hpp"
 #include "math/random_generator.hpp"
 #include "object/bullet.hpp"
 #include "object/camera.hpp"
@@ -1173,7 +1174,11 @@ Player::collision_solid(const CollisionHit& hit)
                                       90-40, 90-20,
                                       Vector(280, -260), Vector(0, 300), 3, Color(.4f, .4f, .4f), 3, .8f,
                                       LAYER_OBJECTS+1));
+
       Sector::current()->camera->shake(.1f, 0, 5);
+
+      if (g_haptic_manager != NULL)
+        g_haptic_manager->playEffect (ST_HAPTIC_EFFECT_BUTTJUMP);
     }
 
   } else if(hit.top) {