Question: Drracket program coding problem: Simulate Balloon popping ; Balloon popping ( define WIDTH 5 0 0 ) ( define HEIGHT 5 0 0 ) (

Drracket program coding problem: Simulate Balloon popping ; Balloon popping
(define WIDTH 500)
(define HEIGHT 500)
(define MTS (empty-scene WIDTH HEIGHT))
(define BALLOON-COLOR "red")
(define POP-IMAGE
(overlay (text "POP!" 80 "black")
(radial-star 30(/ WIDTH 10)(/ WIDTH 2) "solid" "yellow")))
(define CTR-X (/ WIDTH 2))
(define CTR-Y (/ HEIGHT 2))
(define SPEED 2)
(define MAX-SIZE (/ WIDTH 2))
(@htdd Balloon)
;; Balloon is ...????
;; FUNCTIONS ====================================
(@problem 2)
(@htdf main)
;(@signature WS -> WS) ;!!! UNCOMMENT once WS is replaced with world state type
;; starts the world program with !!!
; no examples for main function
(@template-origin htdw-main)
(define (main ws)
(big-bang ws ; WS
(on-tick tick) ; WS -> WS
(to-draw render) ; WS -> Image
; (stop-when ...) ; WS -> Boolean
; (on-mouse ...) ; WS Integer Integer MouseEvent -> WS
; (on-key ...) ; WS KeyEvent -> WS
))
(@problem 3)
(@htdf tick)
;(@signature WS -> WS) ;!!! UNCOMMENT when WS is replaced by world state type
;; produce the next ...
;; !!!
(define (tick ws)...)
(@problem 4)
(@htdf render)
;(@signature WS -> Image) ;!!! UNCOMMENT when WS is replaced by world state type
;; render ...
;; !!!
(define (render ws)...)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!