Using the program shown below as a starting point, write a
program that moves a sprite from the upper right-hand corner of a
window toward the lower left-hand corner (stopping when the Esc key is
tapped). You may check your work with a computer, but try to
solve the problem to your satisfaction before going to a computer.
Program Moving_Sprite
Method Main()
Define Xpos As Decimal = 500
Define Ypos As Decimal = 200
Define first_sprite As Sprite
Define waiting_time As Integer = 15
Define flag_speed As Decimal = 1
first_sprite.Load( "ohio-flag.gif" )
first_sprite.MoveTo( Xpos, Ypos )
first_sprite.Show()
While Not Keyboard.IsKeyDown( Keys.Escape )
Xpos = Xpos - flag_speed
Delay( waiting_time )
first_sprite.MoveTo( Xpos, Ypos )
End While
End Method
End Program