Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
itsliv
itsliv's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
I need help with a conditional! N00b here.
[4 Replies]
01-Feb-2012 02:19 PM
Forum:
Programming Questions
Hello all.
I'd be forever thankful if one of you could help me out. I need to create a simple piece of code for class. So far I have this:
float a = 200;
void setup()
{
size(700, 480);
loop();
}
void draw()
{
background(51);
a = a - 1.5;
if (a < 0) {
a = height;
}
line(0, a, width, a);
stroke(255);
line(0, a*.5, width, a*.5);
stroke(#90102E);
line(0, a*.2, width, a*.2);
stroke(#54C8CB);
line(0,a-300, width, a-300);
stroke(0);
line(0, a*.3, width, a*.3);
stroke(#F2F7B6);
line(0,a*.1,width,a*.1);
stroke(#8D9817);
}
I'd like to set a condition so that if the line's reach the top of the canvas, they bounce back into the screen. Help?
«Prev
Next »
Moderate user : itsliv
Forum