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

Grouping conditional operators

$
0
0

@on4now4 wrote:

is there a way to group conditional operators in an if statement?

something like this:

    if (obsticle.x > 980 && (rightPaddle.y < obsticle.y < rightPaddle.y+200))
    {

    xi *= -1;
     }
   obsticle.x = obsticle.x + (1*xi);

the goal is if obsticle.x is between the two numbers then it will change directions. if not it will continue unchanged.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles