more fixes

This commit is contained in:
Dave Griffiths 2009-10-22 11:31:11 +01:00
parent b946820ad6
commit 990736cd5c
6 changed files with 25 additions and 29 deletions

View file

@ -25,14 +25,14 @@
(define curl-amount 40)
(define start-size 50)
(define max-ornaments 5) ; per twig
(define nutrient-twig-size-increase 2)
(define nutrient-twig-size-increase 1)
(define num-worms 10)
(define num-spiders 10)
(define num-butterflies 10)
(define auto-twig-var 5)
(define auto-time 10)
(define pickup-check-prob 20)
(define max-pickups 100)
(define max-pickups 300)
(define insect-send-prob 3)
; moveme
@ -527,8 +527,8 @@
(set! leader-twig #f))))
(define/public (add-property name)
0 #;(if (eq? name 'nutrient)
(set! twig-size (+ twig-size nutrient-twig-size-increase))
(set! twig-size (+ twig-size nutrient-twig-size-increase))
(when (not (eq? name 'nutrient))
(set! properties (cons name properties))))
; we need to maintain our list of twig ids here, for this plant
@ -543,19 +543,13 @@
(set! next-ornament-id (+ next-ornament-id 1))
next-ornament-id))
(define/public (check-pickup pickup)
(define/public (check-pickup pickups)
(when (or is-player (random pickup-check-prob)) ; reduce the frequency for non-player plants
(when leader-twig
(send leader-twig check-pickup pickup))
#;(foldl
(lambda (twig found)
(if (not found)
(when (send (cadr twig) growing?)
(send (cadr twig) check-pickup pickup))
#f))
#f
twigs)))
(for-each
(lambda (pickup)
(send leader-twig check-pickup pickup))
pickups))))
(define/public (destroy-twig twig)
(send-message 'shrink-twig
@ -662,6 +656,7 @@
this
twig
point-index)))))))
(printf "plant ~a has ~a twigs~n" id (length twigs))
(map
(lambda (twig)
(send (cadr twig) update t d))
@ -782,18 +777,17 @@
; to distribute the cpu load
(define/augment (update t d)
(printf "num pickups ~a~n" (length pickups))
(run-auto-pilot t d)
(when (zero? (random insect-send-prob))
(insect-send))
(for-each
(lambda (pickup)
(for-each
(lambda (plant)
(send plant check-pickup pickup))
plants))
pickups)
(for-each
(lambda (plant)
(send plant check-pickup pickups))
plants)
; remove the pickups that have been 'picked up'
(set! pickups (filter
@ -801,7 +795,7 @@
(not (send pickup picked-up?)))
pickups))
(append
(append
(map
(lambda (plant)
(send plant update t d))

View file

@ -952,7 +952,8 @@
(parent root)
(make-object dust%)) #f))
(nutrients (if (and #f is-player) (let ((p (with-state
(hint-depth-sort)
;(hint-depth-sort)
(hint-nozwrite)
(hint-unlit)
(parent root)
(blend-mode 'src-alpha 'one)
@ -1236,7 +1237,8 @@
(define/public (set-mode-on num-markers)
(when (> num-markers (length markers))
(set! markers (append markers (make-marker-list 10))))
(set! markers (append markers (make-marker-list
(- num-markers (length markers))))))
(set! next-marker 0)

View file

@ -7,7 +7,7 @@ void main()
{
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
gl_FrontMaterial.diffuse,
smoothstep(-5.0,5.0,P.y+Origin.y));
smoothstep(-2.0,2.0,P.y+Origin.y));
gl_FragColor = vec4(MidColour.xyz*texture2D(BaseMap, T).xyz,1);

View file

@ -21,7 +21,7 @@ void main()
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
gl_FrontMaterial.diffuse,
smoothstep(-5.0,5.0,P.y));
smoothstep(-2.0,2.0,P.y));
vec4 HighlightColour=MidColour*1.3;
vec4 ShadowColour=MidColour*0.6;

View file

@ -17,7 +17,7 @@ void main()
float OutlineWidth=0.2;
vec4 MidColour=gl_FrontMaterial.diffuse;
if (Origin.y<0) MidColour=vec4(0.171,0.273,0.336,1);
if (Origin.y<0.0) MidColour=vec4(0.171,0.273,0.336,1.0);
vec4 HighlightColour=MidColour*1.3;
vec4 ShadowColour=MidColour*0.6;
HighlightColour.a=1.0;

View file

@ -19,7 +19,7 @@ void main()
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
gl_FrontMaterial.diffuse,
smoothstep(-5.0,5.0,P.y));
smoothstep(-2.0,2.0,P.y));
vec4 HighlightColour=MidColour*1.3;
vec4 ShadowColour=MidColour*0.6;