FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   multiple void loops
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: multiple void loops  (Read 208 times)
614a616368


multiple void loops
« on: Dec 13th, 2003, 6:42pm »

i'm making a script that draws lines on mouse press based on the continuous lines example then if we press A it generates lines kind like the ellipse exemple that makes ellipses depending on mouse speed.it has a statement for random colloring.
if we press b something different happens, again with lines.
the thing is i want to make rectangles and ellipses like the pattern example when pressing C.
i think i need to make a new void loop to draw the elipses and rectangles but i get a unexpected void error.anyway to go arround this error?
« Last Edit: Dec 13th, 2003, 6:43pm by 614a616368 »  

20000hz sinewave anyone?
arielm

WWW
Re: multiple void loops
« Reply #1 on: Dec 14th, 2003, 11:39pm »

there is no such thing as an additional "void loop()", i.e. you can do a lot of different things inside the single current "void loop()"...
 
it looks like you need to introduce "global variables" of type "boolean" that will be updated within "keyPressed" and "keyReleased", and that will be read within "loop": according to the state of these separate variables (one for each shape you're interested to draw), your code will decide wether or not to render these shapes.
 
does it make sense?
 

Ariel Malka | www.chronotext.org
614a616368


Re: multiple void loops
« Reply #2 on: Dec 20th, 2003, 2:02am »

ah i see define all the things i wish to have an action previously and then inside void loop() make them work
 

20000hz sinewave anyone?
Pages: 1 

« Previous topic | Next topic »