The use of timer implies that you have a event driven game loop (advancing only if an input event happens) instead of a continuously running game loop. Objects and rooms imply imply the need of a continuously running game loop.

The -1.5 was the initial X position of the object on the screen. Until that position was different then -2.3, the X variable should decrease -0.1, making it translate. Now I've created two global variables w/ the initial and final position, so I'm comparing these two.

2. you are doing all the movement in the while loop. So even if the while statement would evaluate to false, it would mean that the object will be instantly in the new position. But since the comparisons that will be never true probably, you are more likely get stuck in an infinite loop. (Plus a sidenote, in cases like this ("increase some value until it reaches a certain value") I would use '<' or '<=' instead of '!='. Because it's pretty easy to make the mistake of jumping over the value even with integers, so that the statement will never evaluate to false.)To solve this, you need to check and advance the motion in the main game loop or in the TimerFunc but only with the small, time dependant value (so not with a while, but an if statement).

3. Are you sure you don't want a continuously running game loop? If you want a continuously running game loop, then don't use a TimerFunc, but an IdleFunc with proper timing (for starters, see "Game Speed dependent on Variable FPS" section of the linked article).

It's hard to explain everything, because you seem to miss fundamental stuff in game programming.

Yeah, I know, my doubt is more related to basic programming than anything else.

Now I did read the links you recommended properly, and I'm starting to understand a bit more about the problems related to floating comparisons (although it looks like I'm way too noob to get some of those stuff as of now). And a TimerFunc, in the case I need, looks a better option (than an IdleFunc).

Thanks for your reply, 'cause it opened my eyes to problems I didn't know existed. I'll just test and study more to get to the result I want.