File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ function setup() {
9898 offsetX = 0 ;
9999 offsetY = 0 ;
100100 zoom = 0.75 ;
101+
101102 actRandomSeed = 6 ;
102103
103104 cursor ( HAND ) ;
@@ -125,6 +126,8 @@ function draw() {
125126 translate ( centerX , centerY ) ;
126127 scale ( zoom ) ;
127128
129+ push ( ) ;
130+
128131 actColorIndex = 0 ;
129132 fill ( palette [ actColorIndex ] [ 0 ] , palette [ actColorIndex ] [ 1 ] , palette [ actColorIndex ] [ 2 ] ) ;
130133 rect ( 0 , - 25 , 10 , 35 ) ;
@@ -180,7 +183,7 @@ function draw() {
180183 push ( ) ;
181184 translate ( random ( - 300 , 300 ) , random ( - 300 , 300 ) ) ;
182185 rotate ( floor ( random ( 8 ) ) * QUARTER_PI ) ;
183- actColorIndex = actColorIndex + 1 ;
186+ actColorIndex = ( actColorIndex + 1 ) % palette . length ;
184187 fill ( palette [ actColorIndex ] [ 0 ] , palette [ actColorIndex ] [ 1 ] , palette [ actColorIndex ] [ 2 ] ) ;
185188 rect ( 0 , - 25 , 10 , 35 ) ;
186189 break ;
@@ -242,6 +245,8 @@ function draw() {
242245 // blink cursor after text
243246 fill ( 200 , 30 , 40 ) ;
244247 if ( frameCount / 6 % 2 == 0 ) rect ( 0 , 0 , 15 , 2 ) ;
248+
249+ pop ( ) ;
245250}
246251
247252function mousePressed ( ) {
You can’t perform that action at this time.
0 commit comments