'Set the Graphics Window size and sow with your title
GraphicsWindow.Show()
GraphicsWindow.Title = "My Simple Animation"
GraphicsWindow.Height = 600
GraphicsWindow.Width = 600
''Set the global variable for draing car for animation
xval=20
yval=160
carWidth=150
carHeight=40
' redraw the car for every time delay
up:
' to Draw the road
GraphicsWindow.BrushColor = "black"
GraphicsWindow.PenWidth = 2
GraphicsWindow.PenColor = "Black"
GraphicsWindow.PenWidth = 2
'for adding the Top Part of Car
GraphicsWindow.DrawRectangle(xval+carWidth/4, yval-carHeight+10, carWidth/2, carHeight-10)
GraphicsWindow.BrushColor = "Orange"
GraphicsWindow.FillRectangle(xval+carWidth/4, yval-carHeight+10, carWidth/2, carHeight-10)
'for adding the Main Part of Car
GraphicsWindow.DrawRectangle(xval, yval, carWidth, carHeight)
GraphicsWindow.BrushColor = "Orange"
GraphicsWindow.FillRectangle(xval, yval, carWidth, carHeight)
'' for Draw Back Wheel
GraphicsWindow.BrushColor = "black"
GraphicsWindow.DrawEllipse(xval+carWidth/12, yval+carHeight, 34, 34)
GraphicsWindow.BrushColor = "gray"
GraphicsWindow.FillEllipse(xval+carWidth/12, yval+carHeight, 34, 34)
'' for Draw Front Wheel
GraphicsWindow.BrushColor = "black"
GraphicsWindow.DrawEllipse(xval+(carWidth-46), yval+carHeight, 34, 34)
GraphicsWindow.BrushColor = "gray"
GraphicsWindow.FillEllipse(xval+(carWidth-46), yval+carHeight, 34, 34)
'for the timer we use this delay
Program.Delay(1000)
'after the delay time we clear all the graphics
GraphicsWindow.Clear()
'using Goto we will again redraw the graphics with new xval position
If xval+carWidth <=GraphicsWindow.Width Then
xval=xval+20
Else
xval=20
EndIf
Goto up