This page contains only the bare-bones information.
(make-package model message)
to update model and send a message.A main function start-big-bang
to launch the windows.
(define (start-big-bang my-name initial-model)
(big-bang initial-model
(on-draw draw-h)
(on-receive receive-h)
(on-key key-h)
(register LOCALHOST)
(name my-name)
(close-on-stop true)))
The launch-many-worlds
command to quickly and easily start several windows.
(launch-many-worlds
(start-big-bang "whale" (make-model "blue" "gray"))
(start-big-bang "squirrel" (make-model "red" "yellow")))
You cannot send posns without a hack. The hack is to make a separate file that contains
a little bit of lower level Racket code and require it. This code could go in your posn-util.rkt
file! You need to use Racket mode, not Beginning Student.
#lang racket
(provide (all-defined-out))
(define-struct posn (x y) #:prefab)
Universe in Racket Documentation. See especially Section 2.4.7, the examples, where a ball-bouncing example is developed.