Back to WeScheme Projects
Running the UFO program:
Type "UFO" in the Interactions section of the browser. This will show the UFO image.
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?))