tcl - Animate oval in projectile motion -
i want animate oval/ball object projectile motion, beingness kicked football game player. not making game.
what lack technical knowledge of tcl, specially when 1 using code written else.
shortly: animated ball projectile motion on canvas controlled start/stop button
there examples available, need improve command , specially "projectile motion" in tcl.
i appreciate code-related help, since not tcl-programmer (even after trying larn technicalities).
you draw ovals (including round ones) on tk canvas widget.
canvas .c -width 500 -height 500 pack .c set ovalid [.c create oval 0 0 5 5] you animate changing coordinates time time.
.c coords $ovalid $x $y [expr {$x + 5}] [expr {$y + 5}] you have permit event loop run between animation steps, though idle event processing vital (as tk redraws on idle).
update idletasks then need compute new position each timestep , utilize coordinate update code above move oval; that's animation is.
tcl tk
No comments:
Post a Comment