Post by Hannes Vilhjalmsson on May 16, 2011 3:44:23 GMT -5
There are several things you need to fix:
1. Create the two instances of LerpPosInterval in the constructor of the factory and store them as member variables. Otherwise they will only exist inside your "set_door" function and won't move once you leave that function.
2. In line 24, now you don't need to pass the "door" since you can create the LerpPosIntervals in the constructor itself.
3. Also make "boolean_open" a member variable of factory and initialize it in the constructor. If you take a look at your line 75, it makes little sense to intitialise the variable there and then immediately ask whether it's false, since you just made it false.
4. After you check whether "boolean_open" is false or true, just call the start method of the intervals directly, there is no need to change the handling of the "space" message. The idea is that the "set_door" function will always do the right thing when you press space bar, based on the state of the "boolean_open" variable, which you have to remember to change.
Hope that helps. I have the feeling that you are not making use of class member variables in Python. See if you find some documentation about assigning values to member variables and using them across different member functions.