07 Big Bang

We learn how to launch more than one world at a time using launch-many-worlds.

The most common way to launch more than one big-bang is by writing a function that runs a big-bang. The function usually takes in the name of the world (which is used to title the window) and the initial model.

(define (start-bang title initial)
   (big-bang initial
      (name title)
      (register LOCALHOST) ;; see 08 Server
      (to-draw draw-h)
      (on-key key-h)
      (on-receive receive-h)))

You can then launch two worlds like this:

(launch-many-worlds
   (start-bang "first" (make-ic 1 "orange"))
   (start-bang "second" (make-ic 2 "light blue")))

Test your setup with two worlds. Make sure each can randomize the color when you hit “r” in their window.

Last modified March 15, 2024: wy-cs site update 2024-03-15 13:30 (1f67698)