Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Grouping conditional operators

$
0
0

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.


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>