For Everyone: How to set up a Perpetual Patrol

A reference to this: http://forum.flowlab.io/discussion/746/preventing-sprites-from-losinggaining-velocity-when-they-collide-#Item_5

I was having problems with Sprites hitting objects and changing speed and direction. Im not sure how this works with two moving sprites hitting each other, but this does work when it comes to setting up what i call a perpetual patrol. Meaning, the sprite will move, hit something, and go in the opposite direction and maintain its speed. Instead of slowing down.

Explanation here, from that link above:

"Here is the setup:

Once > (In, the node that’s connected to the Once) Number (x, where x is the value in the number behavior) > (x or y or both) Velocity.

Collision (set to Any Type or specified type) > (Back, the node that’s connected to the Collision behavior) Flip > (In, the node that’s been connected to Flip) the same Number behavior as mentioned before.

Thus:

Once > Number > Velocity

Collision > Flip > same Number

^ This is how you set up a perpetual patrol Otherwise, it will slow down when it hits something. Setting the velocity to Always Number Velocity makes it agitate. Setting it to Once Number Velocity causes it to lose speed.

The Flip (with the Collision’s Out node connected to Flip’s Back node) and that Flip behaviors Out node (any of the 3 will do) connected to the Number that’s connected to the Velocity keeps it moving."

5 is simply an example. Any value will do (except for 0, 1 and -1) Also, the Collision can be set to Any Type. I have it set to the Sprites I designated as Wall, but any sprite type or the Collision setting “Any Type” will work.

Perpetual Patrol