Vibration when hitting rocks and octopuses
[ghostsoverboard] / ship.cpp
index 040e776..7ab50ff 100644 (file)
--- a/ship.cpp
+++ b/ship.cpp
@@ -1,5 +1,31 @@
+/**************************************************************************
+        Ghosts Overboard - a game for Maemo 5
+
+        Copyright (C) 2011  Heli Hyvättinen
+
+        This file is part of Ghosts Overboard
+
+        Ghosts Overboard is free software: you can redistribute it and/or modify
+        it under the terms of the GNU General Public License as published by
+        the Free Software Foundation, either version 2 of the License, or
+        (at your option) any later version.
+
+        This program is distributed in the hope that it will be useful,
+        but WITHOUT ANY WARRANTY; without even the implied warranty of
+        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        GNU General Public License for more details.
+
+        You should have received a copy of the GNU General Public License
+        along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+**************************************************************************/
+
+
 #include "ship.h"
 #include <QDebug>
+#include <QDBusMessage>
+#include <QDBusConnection>
+
 
 Ship::Ship(QList<QPixmap> pixmapList, QGraphicsItem *parent) :
     OrientationControlledGraphicsPixmapObject(pixmapList.at(0),parent)
@@ -64,5 +90,21 @@ void Ship::dropAllGhosts()
     emit droppingGhosts(ghostsAboard_);
     ghostsAboard_ = 0;
     updateShipImage();
+
+    //vibrate
+
+
+    QDBusMessage message = QDBusMessage::createMethodCall("com.nokia.mce","/com/nokia/mce/request","com.nokia.mce.request","req_vibrator_pattern_activate");
+
+    QList<QVariant> arguments;
+
+    arguments.append("PatternChatAndEmail");
+
+    message.setArguments(arguments);
+
+    message = QDBusConnection::systemBus().call(message);
+
+    qDebug() << message;
+
 }