Closed BryceLTaylor closed 6 years ago
Fix is changing Math.floor
to Math.round
here: https://github.com/LLK/scratch-vm/blob/f9814a5f884df836da4da8f249a27e5ea9861460/src/blocks/scratch3_control.js#L52
I can make a PR if (this is labelled help-) wanted :P
Edit: Oops I accidentally made the PR (with a unit test) anyways. Sorry. #1475
This could relate to the discussion in #202, though in this case compatibility is probably more important than consistency
Dup of Repeat block treats its argument differently than in Scratch 2.0 #1083
Tracking in https://github.com/LLK/scratch-vm/issues/1083. @towerofnix I added "help wanted" to that issue. :-)
@thisandagain Ah right, updated the PR so it auto-closes that issue once it's merged!
It appears that if you put a decimal in a repeat block (Repeat 3.5 times) in 2.0 it seems to round to the nearest integer while 3.0 seems to use floor and always round down. You can see that in this project: https://llk.github.io/scratch-gui/develop/compatibility-testing.html#238650956 In which I change several variables by 1 in repeat loops that all have decimals in them.
And also in this project: https://llk.github.io/scratch-gui/develop/compatibility-testing.html#188149848 which uses a repeat to change the ghost effect on the Thumbnail sprite 2.5 times. In 2.0 this changes it 3 times while in 3.0 it changes it 2 times.