feature-more-radius-fns #16
| @ -1,5 +1,6 @@ | |||||||
| // calculate tiles
 | // calculate tiles
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| const RADIUS_OPTS = [  | const RADIUS_OPTS = [  | ||||||
| 	"const", | 	"const", | ||||||
| 	"right", | 	"right", | ||||||
| @ -12,6 +13,7 @@ const RADIUS_OPTS = [ | |||||||
| 	"left-down", | 	"left-down", | ||||||
| 	"in", | 	"in", | ||||||
| 	"out", | 	"out", | ||||||
|  | 	"noise", | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| function distance(dx, dy) { | function distance(dx, dy) { | ||||||
| @ -70,6 +72,8 @@ class DotMaker { | |||||||
| 	      		return 2 * maxr * distance((d.x - this.cx), (d.y - this.cy)) / this.width; | 	      		return 2 * maxr * distance((d.x - this.cx), (d.y - this.cy)) / this.width; | ||||||
| 	      	case "in": | 	      	case "in": | ||||||
| 	      		return 2 * maxr * (0.5 * this.width - distance((d.x - this.cx), (d.y - this.cy))) / this.width; | 	      		return 2 * maxr * (0.5 * this.width - distance((d.x - this.cx), (d.y - this.cy))) / this.width; | ||||||
|  | 	      	case "noise": | ||||||
|  | 	      		return maxr * Math.random(); | ||||||
| 	    	default: | 	    	default: | ||||||
| 	      		return maxr; | 	      		return maxr; | ||||||
| 	  } | 	  } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user