We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › How to control the position of 2 lines
Page Index Toggle Pages: 1
How to control the position of 2 lines (Read 306 times)
How to control the position of 2 lines
Apr 20th, 2008, 11:56pm
 
I am doing an assignment. I was confuse of how to use the line syntax.
It saids,

Control the position of two lines with one variable.

Control the position and size of two lines with two variables.
Control the properties of two shapes with two variables.

How would I start off to do these processes?
Re: How to control the position of 2 lines
Reply #1 - Apr 21st, 2008, 3:20am
 
You probably want to make a function that creates either lines or shapes and takes the number of variables that are being asked for as arguments.

for example:

void draw(){
 makeline(1,2);
}

void makeline(float x, float y){
 line(x,y,x+10,y+10);
}

I'm guessing this is what you're asking for.  Controlling the position of something in 2d requires at least two variables though, so i'm not sure what they mean by the one variable thing.
Page Index Toggle Pages: 1