[gcompris-devel] Intro_gravity activity

Matilda Bernard serah4291 at gmail.com
Thu May 24 20:42:33 UTC 2012


>If you start from planet A it seems to work but on starting with
>planet B there is some problem. I'm working on that.

I realized this was because int function takes the lower value in a
float number and the functions:
self.mid_planet.set_properties(x=self.position,y=200) and
gcompris.utils.item_absolute_move(self.mid_planet,self.position,200)
accept only int values.  So on adding a float value to the position
(i.e. moving to the right ) was not giving a change in position
whereas on subtracting that value (moving to the left) was changing
the position of the middle planet.

So incrementing position by 1,2,3,...so on after every 500
milliseconds to show acceleration and incrementing by 1 to show
velocity is working fine. Also, the activity once started would last
20 seconds. Is that okay?

I've made the change in the code in my forked repository. -
https://github.com/serah/GCompris/blob/master/src/intro_gravity-activity/intro_gravity.py

So, now I need to work on the scaling issue




More information about the Gcompris-devel mailing list