How that bit of code worked was by using statements that resolved to 1s and 0s, as a way of determining direction. For instance (x>5) will return a 0 if x is less than 5, otherwise 1 signifying it was true. So, when I switched the sign from - to +, I forgot to switch the direction of the two statements.
- Code: Select all
((x>view.x+view.width) - (x<view.x));
// that's pretty much saying (to the right of the screen) - (to the left of the screen)
If you multiply the result by -1 (switching from - to +) you would need to flip those two ((to the left) - (to the right)).