# Shapes info • ### Question

• Is there a way to animate a ball and zooming it to become bigger or smaller as it moves along?
Monday, November 29, 2010 7:27 PM

• Yes, all you have to do is use Shapes.Zoom at the same time you use Shapes.Move.  I don't think there is a way to do it using the Shapes.Animate method, which is generally most useful for simple aninmated title screens for example rather than dynamics simulations of a ball.  You will need to calculate the zoom factor and maybe store its value in an array, just as you do its position or velocity; simple example:

gw = GraphicsWindow.Width
gh = GraphicsWindow.Height

x = gw/2
y = gh/2
u = 1
v = 1

While ("True")
x = x+u
y = y+v
zoom = 1+2*y/gh
u = -u
u = -u
EndIf
v = -v
v = -v
EndIf
Shapes.Zoom(ball,zoom,zoom)
Program.Delay(5)
EndWhile

• Marked as answer by Wednesday, December 1, 2010 1:44 AM
Monday, November 29, 2010 7:49 PM

### All replies

• Yes, all you have to do is use Shapes.Zoom at the same time you use Shapes.Move.  I don't think there is a way to do it using the Shapes.Animate method, which is generally most useful for simple aninmated title screens for example rather than dynamics simulations of a ball.  You will need to calculate the zoom factor and maybe store its value in an array, just as you do its position or velocity; simple example:

gw = GraphicsWindow.Width
gh = GraphicsWindow.Height

x = gw/2
y = gh/2
u = 1
v = 1

While ("True")
x = x+u
y = y+v
zoom = 1+2*y/gh
u = -u
u = -u
EndIf
v = -v
• 