NetLogo version NetLogo 3.0.2
Running with NetLogoLite.jar version 302.
NetLogo Version: NetLogo 3.0.2
;;;; SUMMARY ;; The mouse makes the bubbles swell ;; COPYRIGHT ;;;; Copyright (C) 2006 James P. Steiner ;;;; Some Rights Reserved. ;;;; Licensed under Creative Commons Attribution-Non-Commercial-Share-Alike licens 2.0. ;;;; globals [ mx my ticks ] to startup setup end to setup ca ask random-n-of (.75 * count patches) patches [ sprout 1 [ setxy random 100 random 100 set shape "circle" ] ] end to go every ( 1 / 30 ) [ no-display ;; set ticks ticks + 1 ifelse mouse-inside? [ set mx (mx + mouse-xcor) * .5 set my (my + mouse-ycor) * .5 ] [ set mx mx * .9 set my my * .9 ] ask turtles [ rt -10 + random-float 20 jump .1 * size let dist distancexy mx my let alter (dist ) / (screen-edge-x * .75) ifelse alter < .5 [ set size 1 + 5 * (cos (180 * alter)) ] [ if size != 1 [ set size 1 ] ] ] if hidden?-of turtle 0 != hide-all? [ ask turtles [ set hidden? hide-all? ] ] ;; if ticks = 1 [ ;; set ticks 0 ask patches [ set pcolor scale-color gray (count turtles in-radius 3) 0 35 ] ;; ] display ] end
View or download the complete model file (to download: right-click, save-link-as):
-- Download mouse-bubbles_2 --