Category:Actions

If the first sprite is touching the second sprite, then the movement direction of each sprite changes by 180º, and then both sprites move 1 pixel away from each other.

Examples

Example 2

Sprites that are wandering can bounce off of each other.

Example 1

Sprites that are moving left and right using the swimming left and right block can bounce off of each other.

Tips

  • If a sprite’s is programmed with move in direction blocks, this block does not change those directions in the code. This block will not affect the direction of sprites moving with behaviors such as “moving east”.
  • This block works best under the sprite touches sprite event for sprites with behaviors that use the move forward block such as “wandering” or “swimming left and right”.

Found a bug in the documentation? Let us know at documentation@code.org