WeScheme Project, March 9, 2012, Cardinal Forest Elementary School

WeScheme website

Back to WeScheme Projects

  1. UFO in WeScheme

    Running the UFO program:

  2. The program for UFO in WeScheme:

  3. Type the code to load the UFO image, from Brown University, Computer Science dept.

    Type "UFO" in the Interactions section of the browser. This will show the UFO image.

  4. Rotate the picture of the UFO.

  5. Place the UFO image in an empty scene.

  6. Place a rotated image in the scene.

  7. Type in the rest of the program. Try to slow down or speed up the UFO. Make it hover in mid-air.

  8. Here again is the program running.

  9. Here is a dive-bombing UFO, rotate 45 degrees.

    If you would like to copy and paste the starting source code, here it is:

    (define (descend w) (+ w 5))
    
    (define (hits-floor? w) (> w 300))
    
    (define UFO 
        (image-url "http://world.cs.brown.edu/1/clipart/ufo.png"))
    
    (define (draw w)
      (place-image UFO 150 w
                   (empty-scene 300 300)))
    
    ;; The use of big-bang starts the world program.
    (big-bang 0                               ;; initially, let the height be zero.
              (on-tick descend 1/15)    ;; tick every 15 frames a second
              (on-redraw draw)              ;; use render to draw the scene
              (stop-when hits-floor?))