Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
ganon
ganon'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
pulsating ellipse
[2 Replies]
21-Aug-2012 01:46 PM
Forum:
Programming Questions
hey there!,
I just started out programming and need a little help.
i'm trying to pulsate an ellipse between a min. and a max. value.
the sketch i made sort of does what i want it to do except for the minimum size i've set.
i'm probably doing it all wrong, but that's why i came here.
best case scenario:
i would be able to control the speed of the pulse and the min/max values between which it pulsates.
here's the sketch:
int growth=50;
void setup()
{
size(500, 350);
background(127);
stroke(127);
smooth();
}
void draw()
{
fill(0,200,200);
if(mousePressed)
{
ellipse(mouseX, mouseY, growth, growth);
}
growth++;
if(growth<50) {growth=growth*+1;}
if(growth>70) {growth=growth*-1;}
}
thanks in advance!
«Prev
Next »
Moderate user : ganon
Forum