diff org/test-creature.org @ 191:66fbab414d45

added muscle exertion debug view.
author Robert McIntyre <rlm@mit.edu>
date Sat, 04 Feb 2012 11:02:19 -0700
parents 2902aca33c6e
children
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Sat Feb 04 10:26:11 2012 -0700
     1.2 +++ b/org/test-creature.org	Sat Feb 04 11:02:19 2012 -0700
     1.3 @@ -147,8 +147,9 @@
     1.4          prop (proprioception! creature)
     1.5          prop-display (view-proprioception)
     1.6  
     1.7 -        muscle-fns (movement! creature)
     1.8 -
     1.9 +        muscle-exertion (atom 0)
    1.10 +        muscles (movement! creature)
    1.11 +        muscle-display (view-movement)
    1.12  
    1.13          me (sphere 0.5 :color ColorRGBA/Blue :physical? false)
    1.14          bell (AudioNode. (asset-manager)
    1.15 @@ -183,9 +184,11 @@
    1.16                  "key-h"
    1.17                  (fn [_ value]
    1.18                    (if value
    1.19 -                    (do
    1.20 -                      (println-repl "muscle activating!")
    1.21 -                      ((first muscle-fns)  199))))
    1.22 +                    (swap!  muscle-exertion (partial + 20))))
    1.23 +                "key-n"
    1.24 +                (fn [_ value]
    1.25 +                  (if value
    1.26 +                    (swap! muscle-exertion (fn [v] (- v 20)))))
    1.27  
    1.28                  })
    1.29          (fn [world]
    1.30 @@ -217,6 +220,8 @@
    1.31            (vision-display (map #(% world) vision))
    1.32  
    1.33            (hearing-display (map #(% world) hearing))
    1.34 +
    1.35 +          (muscle-display (map #(% @muscle-exertion) muscles))
    1.36            
    1.37            ;;(println-repl (vision-data))
    1.38            (.setLocalTranslation me (.getLocation (.getCamera world)))