Octopuses stay on the screen now
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 20 Jun 2011 16:31:07 +0000 (19:31 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 20 Jun 2011 16:31:07 +0000 (19:31 +0300)
timercontrolledtursas.cpp

index 1b89939..07828ff 100644 (file)
@@ -68,14 +68,14 @@ void TimerControlledTursas::move()
 
     QRect sceneRectangle = scene()->sceneRect().toRect();
 
-    if (newx < sceneRectangle.left() || newx > sceneRectangle.right())
+    if (newx < sceneRectangle.left() || newx > sceneRectangle.right()-40)
     {
         changeDirection();
         return;
     }
 
 
-    if (newy < sceneRectangle.top() || newy > sceneRectangle.bottom())
+    if (newy < sceneRectangle.top() || newy > sceneRectangle.bottom()-40)
     {
         changeDirection();
         return;     //the old x and y values remain intact