ScratchData LogoScratchData
Back to scratchlycaterton's profile

Debugging Challenge #1

SCscratchlycaterton•Created July 26, 2023
Debugging Challenge #1
2
2
45 views
View on Scratch

Instructions

Here is a code sequence that needs some debugging. We want the batter to approach the plate and swing at a ball. Every time the program is run, we want the batter to start from the right side of the screen in batting stance. Once at the plate, each costume change should be seen clearly. The problem is, if we are in editor view and drag the batter to the right side of the screen, the code seems like it is working the first time it is run. But the timing of the pitch and swing are off. Then, when the code sequence is run again, the batter is at the plate too early and swinging in the wrong order. Run the code multiple times. Can you debug and come up with a solution so the batter approaches the plate each time, swings in the correct order, and the costume changes can be seen better?

Description

WARNING: Don't look at the possible solution sprite until you've tried debugging the code first yourself!

Project Details

Project ID877707825
CreatedJuly 26, 2023
Last ModifiedAugust 7, 2023
SharedJuly 27, 2023
Visibilityvisible
CommentsDisabled