;; p l a n t e y e s [ copyright (c) 2009 foam vzw : gpl v3 ] #lang scheme/base (require scheme/class fluxus-016/fluxus) (provide (all-defined-out)) (define audio-on #t) (when audio-on (oa-start)) ;; start openAL audio (oa-set-acoustics 1 10000 1 5) ; args: unused, max distance, reference distance, rolloff (oa-set-cull-dist 100) ; sounds further away than this won't be played (define (make-noise sound pos freq vol) (oa-play (oa-load-sample (fullpath sound)) pos freq vol)) (define (play-sound type pos) ;(printf "playing ~a at ~a~n" type pos) (cond ((eq? type 'worm-idle) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'spider-idle) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'butterfly-idle) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'place-marker) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'twig-start-growing) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'twig-start-decay) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'twig-new-ornament) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'going-above-ground) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'going-below-ground) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'growth-collide-with-stone) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'back-in-seed) (make-noise "snd/event01.wav" pos 1 1)) ((eq? type 'finished-growing-twig) (make-noise "snd/event01.wav" pos 1 1)) ))