more fixes
This commit is contained in:
parent
b946820ad6
commit
990736cd5c
6 changed files with 25 additions and 29 deletions
|
@ -25,14 +25,14 @@
|
||||||
(define curl-amount 40)
|
(define curl-amount 40)
|
||||||
(define start-size 50)
|
(define start-size 50)
|
||||||
(define max-ornaments 5) ; per twig
|
(define max-ornaments 5) ; per twig
|
||||||
(define nutrient-twig-size-increase 2)
|
(define nutrient-twig-size-increase 1)
|
||||||
(define num-worms 10)
|
(define num-worms 10)
|
||||||
(define num-spiders 10)
|
(define num-spiders 10)
|
||||||
(define num-butterflies 10)
|
(define num-butterflies 10)
|
||||||
(define auto-twig-var 5)
|
(define auto-twig-var 5)
|
||||||
(define auto-time 10)
|
(define auto-time 10)
|
||||||
(define pickup-check-prob 20)
|
(define pickup-check-prob 20)
|
||||||
(define max-pickups 100)
|
(define max-pickups 300)
|
||||||
(define insect-send-prob 3)
|
(define insect-send-prob 3)
|
||||||
|
|
||||||
; moveme
|
; moveme
|
||||||
|
@ -527,8 +527,8 @@
|
||||||
(set! leader-twig #f))))
|
(set! leader-twig #f))))
|
||||||
|
|
||||||
(define/public (add-property name)
|
(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))))
|
(set! properties (cons name properties))))
|
||||||
|
|
||||||
; we need to maintain our list of twig ids here, for this plant
|
; 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))
|
(set! next-ornament-id (+ next-ornament-id 1))
|
||||||
next-ornament-id))
|
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 (or is-player (random pickup-check-prob)) ; reduce the frequency for non-player plants
|
||||||
(when leader-twig
|
(when leader-twig
|
||||||
(send leader-twig check-pickup pickup))
|
(for-each
|
||||||
|
(lambda (pickup)
|
||||||
#;(foldl
|
(send leader-twig check-pickup pickup))
|
||||||
(lambda (twig found)
|
pickups))))
|
||||||
(if (not found)
|
|
||||||
(when (send (cadr twig) growing?)
|
|
||||||
(send (cadr twig) check-pickup pickup))
|
|
||||||
#f))
|
|
||||||
#f
|
|
||||||
twigs)))
|
|
||||||
|
|
||||||
(define/public (destroy-twig twig)
|
(define/public (destroy-twig twig)
|
||||||
(send-message 'shrink-twig
|
(send-message 'shrink-twig
|
||||||
|
@ -662,6 +656,7 @@
|
||||||
this
|
this
|
||||||
twig
|
twig
|
||||||
point-index)))))))
|
point-index)))))))
|
||||||
|
(printf "plant ~a has ~a twigs~n" id (length twigs))
|
||||||
(map
|
(map
|
||||||
(lambda (twig)
|
(lambda (twig)
|
||||||
(send (cadr twig) update t d))
|
(send (cadr twig) update t d))
|
||||||
|
@ -782,18 +777,17 @@
|
||||||
; to distribute the cpu load
|
; to distribute the cpu load
|
||||||
(define/augment (update t d)
|
(define/augment (update t d)
|
||||||
|
|
||||||
|
(printf "num pickups ~a~n" (length pickups))
|
||||||
|
|
||||||
(run-auto-pilot t d)
|
(run-auto-pilot t d)
|
||||||
|
|
||||||
(when (zero? (random insect-send-prob))
|
(when (zero? (random insect-send-prob))
|
||||||
(insect-send))
|
(insect-send))
|
||||||
|
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (pickup)
|
(lambda (plant)
|
||||||
(for-each
|
(send plant check-pickup pickups))
|
||||||
(lambda (plant)
|
plants)
|
||||||
(send plant check-pickup pickup))
|
|
||||||
plants))
|
|
||||||
pickups)
|
|
||||||
|
|
||||||
; remove the pickups that have been 'picked up'
|
; remove the pickups that have been 'picked up'
|
||||||
(set! pickups (filter
|
(set! pickups (filter
|
||||||
|
@ -801,7 +795,7 @@
|
||||||
(not (send pickup picked-up?)))
|
(not (send pickup picked-up?)))
|
||||||
pickups))
|
pickups))
|
||||||
|
|
||||||
(append
|
(append
|
||||||
(map
|
(map
|
||||||
(lambda (plant)
|
(lambda (plant)
|
||||||
(send plant update t d))
|
(send plant update t d))
|
||||||
|
|
|
@ -952,7 +952,8 @@
|
||||||
(parent root)
|
(parent root)
|
||||||
(make-object dust%)) #f))
|
(make-object dust%)) #f))
|
||||||
(nutrients (if (and #f is-player) (let ((p (with-state
|
(nutrients (if (and #f is-player) (let ((p (with-state
|
||||||
(hint-depth-sort)
|
;(hint-depth-sort)
|
||||||
|
(hint-nozwrite)
|
||||||
(hint-unlit)
|
(hint-unlit)
|
||||||
(parent root)
|
(parent root)
|
||||||
(blend-mode 'src-alpha 'one)
|
(blend-mode 'src-alpha 'one)
|
||||||
|
@ -1236,7 +1237,8 @@
|
||||||
|
|
||||||
(define/public (set-mode-on num-markers)
|
(define/public (set-mode-on num-markers)
|
||||||
(when (> num-markers (length 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)
|
(set! next-marker 0)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ void main()
|
||||||
{
|
{
|
||||||
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
|
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
|
||||||
gl_FrontMaterial.diffuse,
|
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);
|
gl_FragColor = vec4(MidColour.xyz*texture2D(BaseMap, T).xyz,1);
|
||||||
|
|
|
@ -21,7 +21,7 @@ void main()
|
||||||
|
|
||||||
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
|
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
|
||||||
gl_FrontMaterial.diffuse,
|
gl_FrontMaterial.diffuse,
|
||||||
smoothstep(-5.0,5.0,P.y));
|
smoothstep(-2.0,2.0,P.y));
|
||||||
|
|
||||||
vec4 HighlightColour=MidColour*1.3;
|
vec4 HighlightColour=MidColour*1.3;
|
||||||
vec4 ShadowColour=MidColour*0.6;
|
vec4 ShadowColour=MidColour*0.6;
|
||||||
|
|
|
@ -17,7 +17,7 @@ void main()
|
||||||
float OutlineWidth=0.2;
|
float OutlineWidth=0.2;
|
||||||
|
|
||||||
vec4 MidColour=gl_FrontMaterial.diffuse;
|
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 HighlightColour=MidColour*1.3;
|
||||||
vec4 ShadowColour=MidColour*0.6;
|
vec4 ShadowColour=MidColour*0.6;
|
||||||
HighlightColour.a=1.0;
|
HighlightColour.a=1.0;
|
||||||
|
|
|
@ -19,7 +19,7 @@ void main()
|
||||||
|
|
||||||
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
|
vec4 MidColour=mix(vec4(0.171,0.273,0.336,1),
|
||||||
gl_FrontMaterial.diffuse,
|
gl_FrontMaterial.diffuse,
|
||||||
smoothstep(-5.0,5.0,P.y));
|
smoothstep(-2.0,2.0,P.y));
|
||||||
|
|
||||||
vec4 HighlightColour=MidColour*1.3;
|
vec4 HighlightColour=MidColour*1.3;
|
||||||
vec4 ShadowColour=MidColour*0.6;
|
vec4 ShadowColour=MidColour*0.6;
|
||||||
|
|
Loading…
Reference in a new issue