From b4eef248160d8a67e179617bc8cffb50ffafaa38 Mon Sep 17 00:00:00 2001 From: Dave Griffiths Date: Thu, 2 Jul 2009 14:46:07 +0100 Subject: [PATCH] added cursor keys --- plant-eyes/plant-eyes.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plant-eyes/plant-eyes.scm b/plant-eyes/plant-eyes.scm index c713851..4234051 100644 --- a/plant-eyes/plant-eyes.scm +++ b/plant-eyes/plant-eyes.scm @@ -1,5 +1,5 @@ -#lang scheme/base -(require fluxus-016/drflux) +;#lang scheme/base +;(require fluxus-016/drflux) (require scheme/class) ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -685,8 +685,8 @@ (set! child-twig-ids (cons twig-id child-twig-ids))) (define/pubment (grow point) - (let ((growing-noise (oa-load-sample (fullpath "snd/event01.wav")))) - (oa-play growing-noise (vector 0 0 0) (rndf) 0.3)) + (let ((growing-noise (oa-load-sample (fullpath "snd/event01.wav")))) + (oa-play growing-noise (vector 0 0 0) (rndf) 0.3)) (inner (void) grow point)) (define/public (add-ornament point-index property) @@ -1395,10 +1395,10 @@ (set-camera-transform (mtranslate (vector 0 0 -1)))) (define/public (update) - (when (key-pressed "a") (set! yaw (+ yaw 1))) - (when (key-pressed "d") (set! yaw (- yaw 1))) - (when (key-pressed "w") (set! tilt (+ tilt 1))) - (when (key-pressed "s") (set! tilt (- tilt 1))) + (when (or (key-pressed "a") (key-special-pressed 100)) (set! yaw (+ yaw 1))) + (when (or (key-pressed "d") (key-special-pressed 102)) (set! yaw (- yaw 1))) + (when (or (key-pressed "w") (key-special-pressed 101)) (set! tilt (+ tilt 1))) + (when (or (key-pressed "s") (key-special-pressed 103)) (set! tilt (- tilt 1))) ; clamp tilt to prevent gimbal lock (when (> tilt 88) (set! tilt 88))