(define SCENE (empty-scene 500 500))
(define-struct pos (x y))
(define-struct ball (img pos))
;(define (render lst))
(define game (list
(make-ball (circle 10 "solid" "blue") (make-pos 250 250))
(make-ball (circle 10 "solid" "red") (make-pos 150 150))))
(big-bang game
[to-draw render])
Lets say i just want to render all my ball-struct-elements in the list on the SCENE. How can i do this? I know how to do it without a list, but with a list i got some problems.
Im using the beginner student version of racket.
I am thankful for every answer
I tried it recursive but just cant work it out
See 2.3.4 Placing Images & Scenes for functions like
place-imageorplace-images.Function
place-imagesrequires usingposnstructure. If you want to use your ownposstructure, you will have to useplace-image.Beginning Student Language also doesn't provide
foldl, so you have to use some recursion, placing pictures on the scene one by one: