- (let* ((x (car a)) (y (cadr a))
- (angle (caddr a))
- (vx (cadddr a)) (vy (cadddr (cdr a)))
+ (let* ((x (assoc-ref a 'x)) (y (assoc-ref a 'y))
+ (angle (assoc-ref a 'angle))
+ (vx (assoc-ref a 'vx)) (vy (assoc-ref a 'vy))
(nx (+ x vx)) (ny (+ y vy)))
(cond ((> nx max-x) (set! vx -1))
((< nx min-x) (set! vx 1)))
(cond ((> ny max-y) (set! vy -1))
((< ny min-y) (set! vy 1)))
(set! angle (+ angle 1))
(nx (+ x vx)) (ny (+ y vy)))
(cond ((> nx max-x) (set! vx -1))
((< nx min-x) (set! vx 1)))
(cond ((> ny max-y) (set! vy -1))
((< ny min-y) (set! vy 1)))
(set! angle (+ angle 1))
- (list (+ x vx) (+ y vy) angle vx vy)))
+ `((x . ,(+ x vx)) (y . ,(+ y vy)) (angle . ,angle) (vx . ,vx) (vy . ,vy))))
(let ((r (degrees-to-radians (- angle))))
(set! x (+ x (* 4 (sin r))))
(set! y (+ y (* 4 (cos r)))))
(let ((r (degrees-to-radians (- angle))))
(set! x (+ x (* 4 (sin r))))
(set! y (+ y (* 4 (cos r)))))