[gcompris: 45/111] change in calculation for direction of arrow in intro_gravity



commit e3c0b4a2a093615b9e717a1d369ca1d9f810ca2e
Author: serah <serah4291 gmail com>
Date:   Wed Jun 27 23:30:45 2012 +0530

    change in calculation for direction of arrow in intro_gravity

 src/intro_gravity-activity/intro_gravity.py     |    6 ++++--
 src/intro_gravity-activity/intro_gravity.xml.in |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/intro_gravity-activity/intro_gravity.py b/src/intro_gravity-activity/intro_gravity.py
index a8677e7..4bc6684 100644
--- a/src/intro_gravity-activity/intro_gravity.py
+++ b/src/intro_gravity-activity/intro_gravity.py
@@ -194,11 +194,13 @@ class Spaceship(Gcompris_intro_gravity):
                    ( self.planet_left.scale / dist_planet_left**2 ) ) * 200.0 * self.level
     self.tux_spaceship.translate(self.move, 0)
 
+    force_l = self.planet_left.scale / dist_planet_left**2
+    force_r = self.planet_right.scale / dist_planet_right**2
     # Show force direction
-    if self.move > 0:
+    if force_l < force_r:
       self.force_left.props.visibility = goocanvas.ITEM_INVISIBLE
       self.force_right.props.visibility = goocanvas.ITEM_VISIBLE
-    elif self.move < 0:
+    else:
       self.force_right.props.visibility = goocanvas.ITEM_INVISIBLE
       self.force_left.props.visibility = goocanvas.ITEM_VISIBLE
 
diff --git a/src/intro_gravity-activity/intro_gravity.xml.in b/src/intro_gravity-activity/intro_gravity.xml.in
index 6736150..fa41de9 100644
--- a/src/intro_gravity-activity/intro_gravity.xml.in
+++ b/src/intro_gravity-activity/intro_gravity.xml.in
@@ -26,6 +26,7 @@
         Increase and decrease the size of the planets at the two ends to see how the force on the
         spaceship changes with changes in the size and distance. This force results in acceleration of the
         spaceship.
+        The arrow indicates the direction of force.
 
         With every level the speed of the spaceship will increase.
         </manual>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]