CPSC 110 Lecture Notes - Lecture 9: Angle Of Rotation

160 views4 pages
Verified Note
5 Oct 2018
School
Course
Professor

Document Summary

;; design a world program where yoshi eggs appear wherever. ;; the user clicks the mouse and each egg spins as it falls. ;; there are no eggs, but each time the user clicks the mouse. ;; an egg is created at that position and falls directly down. ;; off the screen, spinning counter-clock-wise as it falls. (@htdw listofegg) ;; constants (define width 400) (define height 600) (define ctr-x (/ width 2)) (define ctr-y (/ height 2)) (define mario. ) (define mts (place-image mario. Ctr-x (- height (/ (image-height mario) 2) 5) (empty-scene width height))) (define yoshi-egg . ) (define fall-speed 5) ; pixels per tick (define spin-speed 5) ; degrees per tick (define initial-angle 0) ; starting rotation angle of new eggs. ;; data definitions: (@htdd egg) (define-struct egg (x y r)) ;; interp. the x, y position of an egg in screen coordinates (pixels),

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents