Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    If On Edge, Bounce

    2D Blocks
    1
    1
    2410
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

       

      Prerequisite

      • Working with Blocks

       

      Description

      “If on edge, bounce” is a stack block in the motion category. This block is used to bounce back a sprite from the edges of the stage.


       

      How does this block work?

      When a sprite is touching any edge of the stage, then the “If on edge, bounce” block willturn the sprite away from the edge. It will look like a ball bouncing off a wall.

      For example, if the direction of sprite before bouncing is 90, then the direction of sprite after bouncing will be -90.


       

      Do Not Rotate

      If you do not want the sprite to turn upside-down after bouncing from the edge, then you can set the rotation style of the sprite to “Do not rotate”.

      Click on the direction input box in the sprite pane, , and select the “Do not rotate” mode:

      direction4.PNG

       

       

      1 Reply Last reply Reply Quote 0
      • First post
        Last post