Skip to content

Compatibility

Eric Rosenbaum edited this page Jan 31, 2018 · 31 revisions

There is a special build specifically for testing projects in 2.0 vs. 3.0: add /compatibility-testing.html. You can add #<project-id> to the end to load up a specific project (it must be shared, however). You may also have to specifically whitelist the domain in your flash settings to get the Scratch 2.0 player to load.

Consistent type coercion when modifying variables

In Scratch 2.0 if you set [var] to [var + 1] and the variable contains a string, you get 1. If you change [var] by [1] when the variable contains a string, you get NaN. In 3.0 both now have the same behavior and return 1.

Consistent rounding method for list indexes

In Scratch 2.0 if you delete [1.5] of [list] it will delete the item at index 2 as the index is rounded. However if you replace item [1.5] of [list] with ["thing"] it will replace the item at index 1 as floor is applied to the index. In 3.0 floor is now applied consistently for all index arguments on list blocks.

Reference: https://github.com/LLK/scratch-vm/issues/202

Keyboard input capturing

All keys are captured by Scratch 2.0 when it has focus, so if you use browser keyboard shortcuts e.g. Cmd-Opt-J, the browser does not respond to them. In 3.0, special keys are allowed to propagate so the browser keyboard shortcuts work while Scratch has focus. Scratch 3.0 will continue to register these keys, so when any key pressed blocks will trigger at the same time as the browser shortcut activates.

Touching sprite works with self

Unlike Scratch 2.0, the "touching []" boolean reporter will no longer return true at all times if the reporter argument is set to itself. Instead it will return false unless the rendered target is touching another instance of itself.

Reference: https://github.com/LLK/scratch-vm/issues/377

Consistent direction for "whirl" graphic effect

Scratch 2.0 has two stage modes: 2D and 3D. The "whirl" graphic effect is applied inconsistently between these two modes (clockwise in 2D and counter-clockwise in 3D). Because most users see the 3D stage when using Scratch 2.0 and Scratch 3.0 always uses WebGL for rendering, we have decided to normalize to counter-clockwise application of the "whirl" effect.

Reference: https://github.com/LLK/scratch-render/issues/22

Variable monitors always rendered on top of stage

Scratch 2.0 allows for sprites to occlude monitors as they are treated as part of stage rendering. In Scratch 3.0 monitors are rendered as part of the overall user interface and are independent of the stage. Because of this, sprites can no longer be rendered on top of monitors.

"current ()" block has only one monitor

In Scratch 2.0, it was possible to have monitors for "current second," "current minute," "current hour" etc. simultaneously. In Scratch 3.0, there is only one monitor for the "current ()" block, and it shows whatever the dropdown is set to at the time.

Reference: https://github.com/LLK/scratch-gui/issues/1218

Clones can start playing a sound already being played by another clone

If you have a sprite with the sound "happy song", and you run "forever [start sound happy song]", it will restart the sound every frame, creating a stuttering sound. This is true in both 2.0 and 3.0. However, in 3.0, if you create a bunch of clones, and run "when I start as a clone [start happy song]", the clones will all separately start their own copy of the song. Pro: you can make music using clones that play a sound with different audio effect settings (pitch, pan, volume). Con: you get a loud sound instead of a stuttering sound if you make a lot of clones that play a sound simultaneously.

Issue: https://github.com/LLK/scratch-vm/issues/919

PR: https://github.com/LLK/scratch-vm/pull/891

Clone this wiki locally