CSE 203 Homework 3

You may complete this homework, as any homework in this course, either alone as an individual, or in partnership with one other person.  Please make sure every author's name is listed at the top.
  1. Complete Closed Lab 2 if you haven't already done so.
  2. 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
  3. Optional: If you're getting worried that this course isn't exciting enough for you, you could gain inspiration about Phrogram's possibilities by visiting http://www.phrogram.com.