Discuss Scratch
- spidermanLOLL
-
500+ posts
Screen Shake
SORRY IF THIS IS WRONG FORUM
Like how to do screen shake. My friend told me in a forum post but I can't find it.
Like how to do screen shake. My friend told me in a forum post but I can't find it.
- -Valtren-
-
1000+ posts
Screen Shake
Not really, it's not asking help about a specific script. This belongs in Help With Scripts.
-
What do you mean by screen shake? If you're talking about something that shakes all the sprites on the screen, just make this custom block:
When the variable Shake? is 1, the position block will position the sprite accordingly.
So setup before the shake:
In order to actually shake the screen, there are multiple scripts, but I don't know any except this:
So you'd do this script in order to shake the screen:
Note that every sprite must have the position for screenshake block in a forever loop for the entire screen to shake.
Last edited by -Valtren- (May 18, 2023 13:37:44)
- Za-Chary
-
1000+ posts
Screen Shake
I like the explanation! But what is “Cam Z,” and how is it used?Not really, it's not asking help about a specific script. This belongs in Help With Scripts.
-
What do you mean by screen shake? If you're talking about something that shakes all the sprites on the screen, just make this custom block:
Last edited by Za-Chary (May 18, 2023 12:47:56)
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
I like the explanation! But what is “Cam Z,” and how is it used?Not really, it's not asking help about a specific script. This belongs in Help With Scripts.
-
What do you mean by screen shake? If you're talking about something that shakes all the sprites on the screen, just make this custom block:
In 2D Z position is used as rotation
- -Valtren-
-
1000+ posts
Screen Shake
Cam Z is the variable used for zooming in and out. If you want your screen shake to zoom in or out, use that block. I like the explanation! But what is “Cam Z,” and how is it used?
In 2D Z position is used as rotation

Please don't quote this image just to put your reaction to it, it's unconstructive and off topic.
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
Cam Z is the variable used for zooming in and out. If you want your screen shake to zoom in or out, use that block. I like the explanation! But what is “Cam Z,” and how is it used?In 2D Z position is used as rotationPlease don't quote this image just to put your reaction to it, it's unconstructive and off topic.
Then why in spaceflight sim it was rotated when I set the z
Last edited by gdfsgdfsgdfg (May 18, 2023 13:17:12)
- -Valtren-
-
1000+ posts
Screen Shake
No idea. The variable that controls the camera's direction was called Z.Cam Z is the variable used for zooming in and out. If you want your screen shake to zoom in or out, use that block. I like the explanation! But what is “Cam Z,” and how is it used?In 2D Z position is used as rotationPlease don't quote this image just to put your reaction to it, it's unconstructive and off topic.
Then why in spaceflight sim it was rotated when I set the z
- spidermanLOLL
-
500+ posts
Screen Shake
It didn't work. I tested it here: https://scratch.mit.edu/projects/853141503Not really, it's not asking help about a specific script. This belongs in Help With Scripts.
-
What do you mean by screen shake? If you're talking about something that shakes all the sprites on the screen, just make this custom block:When the variable Shake? is 1, the position block will position the sprite accordingly.
So setup before the shake:In order to actually shake the screen, there are multiple scripts, but I don't know any except this:So you'd do this script in order to shake the screen:Note that every sprite must have the position for screenshake block in a forever loop for the entire screen to shake.
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
-Quote so big that I had to cut it-
Then try this:
https://scratch.mit.edu/projects/784157060
simple and it works
I use this alot
(all of the sprites need to have this block though)
(the stage has to be a sprite if you want to shake it)
Last edited by gdfsgdfsgdfg (May 18, 2023 13:28:40)
- Spentine
-
1000+ posts
Screen Shake
The “Cam Z” variable appears to control the zooming. You just didn't put a (set size to (cam z)%) block.No idea. The variable that controls the camera's direction was called Z.Cam Z is the variable used for zooming in and out. If you want your screen shake to zoom in or out, use that block. I like the explanation! But what is “Cam Z,” and how is it used?In 2D Z position is used as rotationPlease don't quote this image just to put your reaction to it, it's unconstructive and off topic.
Then why in spaceflight sim it was rotated when I set the z
- -Valtren-
-
1000+ posts
Screen Shake
https://scratch.mit.edu/projects/853141503That was an error on my part, I forgot to mention that you had to reset the Cam X and Cam Y values. It didn't work. I tested it here:


That method, while it does work, is inefficient. With my method, the sprites only need to have the position block. Only one sprite has to have the actual shake code, and when it runs all the sprites with position blocks will shake in a fashion that looks like the entire screen is shaking. Then try this:
https://scratch.mit.edu/projects/784157060
simple and it works
I use this alot
(all of the sprites need to have this block though)
(the stage has to be a sprite if you want to shake it)
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
That method, while it does work, is inefficient. With my method, the sprites only need to have the position block. Only one sprite has to have the actual shake code, and when it runs all the sprites with position blocks will shake in a fashion that looks like the entire screen is shaking. I use this alot
(all of the sprites need to have this block though)
(the stage has to be a sprite if you want to shake it)
Its a simple shake code
Last edited by gdfsgdfsgdfg (May 18, 2023 13:36:28)
- -Valtren-
-
1000+ posts
Screen Shake
Shakes the sprite, not the screen.That method, while it does work, is inefficient. With my method, the sprites only need to have the position block. Only one sprite has to have the actual shake code, and when it runs all the sprites with position blocks will shake in a fashion that looks like the entire screen is shaking. I use this alot
(all of the sprites need to have this block though)
(the stage has to be a sprite if you want to shake it)
Its a simple shake code
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
Shakes the sprite, not the screen.That method, while it does work, is inefficient. With my method, the sprites only need to have the position block. Only one sprite has to have the actual shake code, and when it runs all the sprites with position blocks will shake in a fashion that looks like the entire screen is shaking. I use this alot
(all of the sprites need to have this block though)
(the stage has to be a sprite if you want to shake it)
Its a simple shake code
The stage has to be a sprite as I mentioned earlier
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
My method is rng based
and the proof that it can shake the background (its a sprite)
https://scratch.mit.edu/projects/853184644/
and broadcasts are used for indefinite shaking
and the proof that it can shake the background (its a sprite)
https://scratch.mit.edu/projects/853184644/
and broadcasts are used for indefinite shaking
- -Valtren-
-
1000+ posts
Screen Shake
My method is rng based
and the proof that it can shake the background (its a sprite)
https://scratch.mit.edu/projects/853184644/
and broadcasts are used for indefinite shaking

While you are correct that you can make the background shake, you have made a major mistake: You've made an earthquake, not a screen shake.
Confused? Allow me to explain.
The words “screen shake” imply that rather than everything on the screen moving, the screen itself is moving. Thus, when the screen moves in a certain direction, everything on it will move the same way:

However, your shake method has every sprite shaking independently of each other. This means that the sprites will do this:

Thus, that would not be the screen shaking. You rmethod would be California.
My screen shake method works because it accounts for similar sprite movement: you only need to input the shake code in one sprite, and all sprites with the position block will shake the same way. It'll look like the screen is shaking.
That's because, my method utilises something called Cam control, otherwise known as:

That was not as dramatic as I thought it would be
Anyway, thanks to coming to my TED talk of why you should use my method instead of the other person's. Please collect your free barrels of bhindi ki subgi at the door.
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
-Quote so big that I have to cut it-
As I said, its rng based
- -Valtren-
-
1000+ posts
Screen Shake
As I said, it's not a screen shake.-Quote so big that I have to cut it-
As I said, its rng based
- gdfsgdfsgdfg
-
1000+ posts
Screen Shake
As I said, it's not a screen shake.-Quote so big that I have to cut it-
As I said, its rng based
if you read the project description
You would understand before posting