@Ian:
> You mean using add/repeat_timeout to drive the animation? Yes, that's
> fine, a perfectly sensible way to proceed.
> Maybe if you were animating a full physical model with 3-D rendering
> and stuff you might want to do something more sophisticated, but for
> basic animations and so forth it's just fine...
> What are you hoping to achieve in the end with this?

Nothing special, just some simple 2D games :)

@Albrecht:
>Yes, you are, probably.The main problem is in the draw() method. Move
>the calculation of the new random coordinates to the timer callback
>routine, and you should be done.
>
>Without compiling and running your code I can only assume that you must
>do something like resizing the window to see your never ending
>animation. This happens because draw() is called whenever your widget
>needs any updates, e.g. by occluding parts of it or by resizing. Is this
>what you're seeing? This ought to stop if you don't calculate new
>coordinates in draw().

Actually, the first program, the one that works and is supposed to make a never 
ending animation, works fine without any resizing.But the other one, the one 
which should stop the animation, doesn't work at all.

Thank you both, Ian and Albrecht.I think that I'm ready for some games now :)
And I will try to move those calculations.It just never occurred to me.

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to