Universe Resources
This page contains only the bare-bones information.
-
Generic server (see attachment).
-
(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")))
Sending Posns
One possibility is to send the coordinates in a posn as numbers in a list.
You cannot send whole 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. The best place
for this code would be in your posn-util.rkt
file! You need to use Racket mode for
that file, not Beginning Student.
#lang racket
(provide (all-defined-out))
(define-struct posn (x y) #:prefab)
Additional Resources
-
Universe in Racket Documentation. See especially Section 2.4.7, the examples, where a ball-bouncing example is developed.