Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. Tools
  4. Debugging - Breakpoints

Debugging - Breakpoints

Scheduled Pinned Locked Moved Tools
1 Posts 1 Posters 990 Views
  • 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.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

     

    Prerequisite

    • The Repeat Block

     

    What’s a “Breakpoint”

    A “breakpoint” is where the program can “take a break”. That is, it will pause for a moment, and continue when you ask it to. While it is paused, you can do many things to check if your project is working as expected, such as checking the value of variables, the position of sprites, etc.

     

    The “Breakpoint” Block

    To add a breakpoint, you just need to insert the following block at where you would like the project to pause:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/57ae89aa-a07c-4b74-90fe-ee8961b2b9ec.png" width="120" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

    You can add as many breakpoints to your project as you like, although usually only one or few of them are used.

     

    The “Debug” Button

    When you run a program using the green flag button, all breakpoints are ignored. To activate them, you need to run the program in the “Debug Mode” by clicking the blue arrow button:
    dd9f96db-9c23-4783-a482-272ffd90b42f-image.png

    In the debug mode, the program will pause whenever it arrives at a breakpoint. To continue the program from the breakpoint, you just need to click the blue arrow button again.

     

    Example 1

    In this example, we have 2 breakpoints, so the program will pause on the first breakpoint after completing all blocks before it. When we click the blue arrow button again, the program continues until the second breakpoint.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/41f8c075-bfb6-48d0-8301-265390496fbe.gif" width="600" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Example 2

    You can also place the breakpoint inside an “if” block, so that it will only pause the program when a certain condition is met.

    In this example, we will keep moving the dog to the bottom, and only pause the loop when the dog is touching the apple sprite:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/bdf54d3f-a691-4d7e-baac-daed11351a18.gif" width="600" style="border-radius: 5px; border: 1px solid #29622d;">

    1 Reply Last reply
    0
    • CreatiCodeI CreatiCode pinned this topic on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode