Ignore:
Timestamp:
02/28/2011 02:43:48 PM (9 years ago)
Author:
dave
Message:

remote update of characters, auto polling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scenarios/GerminationX/oak/src/oak/plant.clj

    r995 r999  
    2020   clojure.contrib.math)) 
    2121 
    22 (def season-length (* 60 2)) 
     22(def season-length (* 60 10)) 
    2323(def min-health 10) 
    2424(def max-health 90) 
     
    6969(defn make-plant [pos type owner size] 
    7070  (plant. (generate-id) pos type (plant-type->layer type) 
    71           'grow-a '() owner size 0 (+ (/ season-length 80) (Math/floor (rand 10))) start-health)) 
     71          'grow-a '() owner size 0 (+ (/ season-length 10) (Math/floor (rand 10))) start-health)) 
    7272 
    7373(defn make-random-plant [] 
     
    8080; the plant state machine, advance state, based on health 
    8181(defn adv-state [state health season] 
    82   (println "advancing state...") 
    8382  (cond 
    8483   (= state 'grow-a) (cond (> health min-health) 'grow-b :else (rand-nth (list 'grow-a 'grow-b))) 
     
    114113        
    115114(defn plant-update [plant time delta neighbours rules season] 
    116   (println (str season " " (:state plant) " " (:health plant))) 
     115;  (println (str season " " (:state plant) " " (:health plant))) 
    117116  (modify 
    118117   :health 
Note: See TracChangeset for help on using the changeset viewer.