Questions tagged [mit-scratch]

Scratch is a graphical drag-and-drop language developed by MIT.

Scratch is a graphical drag-and-drop language developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is used in a number of grade schools and other educational institutions to teach principles of programming.

It primarily focuses on developing games or other graphics-intensive applications, but it can be used for other tasks as well.

The code interface consists of 'blocks' that are dropped into the editor window and then hooked together to perform tasks. Manipulation of 'sprite' objects is the main focus of the language.

Scratch has inspired several similar programming interfaces, which use its block-manipulation approach to programming.

Other block-programming tools include Snap (also known as Build Your Own Blocks), which extends Scratch with first-class data and better routine-creation tools, Enchanting, which allows programming the Lego NXT controller, and Google's Blockly, which provides generic tools to allow any programming language to be programmed with a block interface. Also Scratch Jr, which focuses on coding for young children (aged 5-7 years), the blocks are placed horizontally instead of vertically like Scratch, as younger children found this easier to understand.

Scratch's official wiki contains documentation and tutorials about all features of Scratch.

Scratch's official discussion forums also contains information concerning Scratch.

Books:

284 questions
3
votes
6 answers

Dragging sprites in Scratch

How do I drag sprites during execution in Scratch?
ruchir patwa
  • 311
  • 1
  • 5
  • 13
3
votes
0 answers

Restarting socket connection following client disconnect

I have this code which listens/sends from/to a Scratch program with remote sensor connections enabled (e.g communicates by Port 42001 on 127.0.0.1) # This code is copyright Simon Walters under GPL v2 # This code is derived from scratch_handler by…
SimpleSi
  • 753
  • 1
  • 10
  • 22
2
votes
1 answer

Is Scratch's (sin of (n)) function incorrect, or am I doing something wrong?

I found a double pendulum ODEs simulation on Desmos, credit to @AlexRLJones, and I am trying to recreate it entirely in Scratch. While writing the code, I noticed that when I put sin(θ₁) with θ₁=50 on either Desmos or a calculator (on Google, my…
aedanp07
  • 21
  • 1
2
votes
1 answer

Why is it that when the ball touches the goalie the backdrop(background) does not change to game over background?

Ball Movement Code: Goalie Movement Code: The code was working before, however it is not working now. I tried to rework my code change my blocks for when the ball touches the goalie to send a message to the goalie and the goalie to send a message to…
2
votes
3 answers

In Scratch, how do you set boundaries on your top down scrolling?

I recently have been working on a scrolling game in scratch, and have been using a simple scrolling method, where the player is always centered and does not move, and the map is incredibly sized up, and moves instead. The problem is that even though…
EldarT
  • 31
  • 4
2
votes
1 answer

KeyError: 'set-cookie" (Replit)

I am trying to use the scratchclient module on REPLIT (python) but when i try to run this code it gives me this random error: Traceback (most recent call last): File "main.py", line 9, in session =…
DybaTube
  • 21
  • 4
2
votes
2 answers

How to stop user from holding down space bar?

I am creating a scratch project where you have to press space bar to move and I have found an exploit: holding down space bar because the project is designed to improve your SBPS (space bars per second) not just hold down space bar. How can I stop…
2
votes
3 answers

I want to know a form of a "Repeat until" block in scratch in python?

I need some help, you know those "repeat until" blocks in scratch? Well I need to know how to do that in python. What I want to do is this, with a repeat block. retry = True if password = "password1234": retry = False else: pass
A_Nobody
  • 39
  • 1
2
votes
3 answers

How to create a Save/Load function on Scratch?

Im trying to make a game on Scratch that will use a feature to generate a special code, and when that code is input into a certain area it will load the stats that were there when the code was generated. I've run into a problem however, I don't know…
ChocolateChara
  • 187
  • 1
  • 16
2
votes
1 answer

Lag when exporting functionality into a block in Scratch

I'm new to scratch. I have this code within a sprite, which works as expected without noticeable lags: But, when I "export" the flickering into the 'flicker' block, it has a very nasty lag: I created a special sprite in order to easily "feel" the…
user1028741
  • 2,745
  • 6
  • 34
  • 68
2
votes
1 answer

How do you check if a Scratch project is shared by its ID?

I don't expect many people to know this, but is there a way to check if a Scratch project ID is of a project that is shared? For instance, the project ID 3 is an actual project, but is not shared - while the ID 399293697 is shared. So how can I see…
Tilier
  • 80
  • 7
2
votes
4 answers

Why is my Scratch Cloud Variable not Updating?

I am making a multiplayer game, which can be found here: project. It has the following script, before the main one. I tested this script thoroughly, but it seems like it isn't working. For some reason, despite the fact that my cloud variable should…
ARI FISHER
  • 343
  • 1
  • 13
2
votes
1 answer

Scratch - How to stop the program, but not exterminate

How do I halt the program while the question isn't answered (collision with stars)? I've tried the stop all block from control, but it exterminates the program. Scratch
Dusernajder
  • 101
  • 1
  • 14
2
votes
2 answers

Why can't I stop the music in a loop in Scratch?

I am making a game and I need title screen music. I added all the code and it doesn't stop playing, it just restarts the music. How do I fix this? I have tried using a repeat until block but it still doesn't work, it just waits until the music is…
The Butler
  • 53
  • 1
  • 8
2
votes
2 answers

Add Boolean-Triggered Event in Scratch?

In Scratch, there are "When" blocks, such as when green flag clicked, when key space pressed, when this sprite clicked, and so on, but if I had a boolean, such as "touching color color", how would I put it in a "When" block like "When touching color…
4yl1n
  • 148
  • 1
  • 10