I know another, but I'm guessing this is super simple to anyone who's aufait with this stuff:
This produces a ball that move from one side of the screen, hits a rectangle and moves back. But there are a couple of thing's that I don't really get and that aren't explained in the tutorial. Highlighted in bold:
1 - If I change the duration of the first animate Operation the ball stops before it hit's the rectangle, I don't understand why this would happen? If the duration is set to around 700ms or higher it stops before hitting the rectangle. (490is the duration given by the tutorial) If i set the duration lower than 490 it still hits the rectangle
2 - in this IF command it say's (Shapes.GetLeft(Sball) - yet it's the right edge of the ball that hit's the rectangle...?
Just find these thing's a bit confusing and it'd be great to have someone with a bit of know explain them
here's the code :
Sball = Shapes.AddEllipse(100, 100) Shapes.Move(Sball, 0, 340) x = 450 GraphicsWindow.DrawRectangle(550, 0, 80, 450) GraphicsWindow.BrushColor = "Purple" GraphicsWindow.FillRectangle(550, 0, 80, 450) Shapes.Animate(Sball, x, 40, 490) Program.Delay(500) If (Shapes.GetLeft(Sball) = x) Then Shapes.Animate(Sball, 0, 340, 500) EndIf