Skip to content

Execution Order of Sprites does not change with ordering #1053

@griffpatch

Description

@griffpatch

Expected Behavior

As encountered in #457 the execution order of scripts across multiple sprites should be in z-index order of the sprites from front to back. Changing the order of the sprites and then re-running the project, or changing them mid execution should cause the execution order to change (note: only for scripts that are not already running - these should maintain the original execution order - it will be worth keeping this in mind when implementing a fix - So if you have a number of forever loops already in progress, the order should not be affected by re-ordering them, but on stopping and re-starting the order will then be updated).

Actual Behavior

In Scratch 3, the order of execution is correct at the time of loading as long as the order is not changed either by the user, or during execution. However, any change in order does not get reflected at runtime and the execution order stays as it was on project load / creation.

Steps to Reproduce

This project randomly shuffles three sprites during runtime and 'says' the order of execution (1 being first, then 2 & 3).

https://llk.github.io/scratch-gui/develop/#216001494

In Scratch 2 the numbers continually shuffle around, but in Scratch 3 they stay constant.

Operating System and Browser

Windows 10 PC - Chrome

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions