If on Edge, Bounce
If on edge, bounce
Category Motion
Type Stack

The If on Edge, Bounce block is a Motion Block and a Stack Block. The block checks to see if its sprite is touching the edge of the screen - and if it is, the sprite will point in the opposite direction.

Behind the ScenesEdit

The If on Edge, Bounce block can't be simply replicated as it changes the direction depending on whether the sprite is touching the top/bottom or left/right sides. If it touching the sides - the direction is simply multipled by -1 which causes the sprite to reflect.

If it is touching the top or bottom then the direction becomes (direction + 180) * -1

Common UsesEdit

  • Preventing a sprite from partially leaving the screen (often, this is followed by the Point in Direction block to stop reflection)
  • Reflection
  • Games such as "Pong"

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.