Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Making a value increase then decreases

$
0
0

@on4now4 wrote:

I am trying to make a variable increase from 0 to 255 and then back to 0 then back to 255 and so on. This is the code I have so far and it does not work. If I comment out either of the if statements it will work one direction but I can not get it to reverse in direction.

if (x >= 0);
{
x = x+1;
}

if (x <= 255);
{
x = x-1;
}

Posts: 11

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles