This may be a silly question but I'm completely new to programming. I'm towards the bottom of the Prologue in "How to Design Programs" (2nd ed) and there are 4 changes that you are challenged to make to the "Rocket Landing" program in DrRacket.
I'm stuck on the 4th one, specifically the bolded part:
How would you change the program so that the rocket lands on a flat rock bed that is 10 pixels higher than the bottom of the scene? Don’t forget to change the scenery, too.
; constants
(define WIDTH 200)
(define HEIGHT 400)
(define SCENE-CENTER (/ WIDTH 2))
(define MTSCN (empty-scene WIDTH HEIGHT "blue"))
(define ROCKET (overlay (circle 10 "solid" "green")
(rectangle 40 4 "solid" "green")))
(define ROCKET-CENTER-TO-TOP
(- (- HEIGHT 10) (/ (image-height ROCKET)2)))
;functions
(define (picture-of-rocket.v2 h)
(cond
[(<= h ROCKET-CENTER-TO-TOP)
(place-image ROCKET SCENE-CENTER h MTSCN)]
[(> h ROCKET-CENTER-TO-TOP)
(place-image ROCKET SCENE-CENTER ROCKET-CENTER-TO-TOP MTSCN)]))
(animate picture-of-rocket.v2)
My rocket (ufo) is doing the first part, stopping 10 pixels from the bottom but I'm not sure how I can draw a rock bed at the bottom with the commands I've learned so far. Do I (overlay) a 10 pixel rectangle at the bottom? Or does the author just mean change the scene background to grey?