2 ;; The 'init signal is sent after the instance is created. This is our chance
3 ;; to initialize fields to non-default values. Note: all the pclass values are
4 ;; defined in game.scm.
5 (define (bridge-init kbridge)
6 (kern-obj-set-pclass kbridge pclass-bridge))
8 ;; Define the interface for the type
11 (method 'init bridge-init)))
13 ;; Make an object type. This is like a "class" in OO languages.
14 (mk-obj-type 'TF_ew_bridge ;; tag
17 layer-tfeat ;; stacking layer
18 bridge-ifc ;; interface
21 (mk-obj-type 'TF_ns_bridge ;; tag
24 layer-tfeat ;; stacking layer
25 bridge-ifc ;; interface
27 ;; ----------------------------------------------------------------------------
28 ;; mk-bridge -- 'dir' is the orientation, one of the four cardinal directions
29 ;; and should be prepended by a single tick when called, as in 'north 'south
31 ;; ----------------------------------------------------------------------------
32 (define (mk-bridge dir)
34 ((north) (bind (kern-mk-obj TF_ns_bridge 1) nil))
35 ((south) (bind (kern-mk-obj TF_ns_bridge 1) nil))
36 (else (bind (kern-mk-obj TF_ew_bridge 1) nil))))