Scratch-gui: 2.0 project's sprite touching color/ another sprite doesn't trigger; ball falls through floor

Created on 6 Jun 2017  路  5Comments  路  Source: LLK/scratch-gui

Reported by Kim during Google Serve meeting (6/5/17):

falling sprite falls through floor (touching color problem?)

Expected Behavior

In 2.0, the ball falls after you click "play", and it stops when it hits the black floor or the black platform.

Actual Behavior

In 3.0, the ball falls through the floor/ platforms to the bottom of the screen.

Some of the sprites don't render the same in 2.0 & 3.0 either; the blue rectangle behind "Play" is smaller, missing it's top and bottom rounded portions in 3.0, and sprite 3 shows up as a vertical rectangle in 2.0 (in its thumbnail in the sprite pane) but shows up as blank/ white in 3.0.

Steps to Reproduce

  • View project 161606350 in 2.0
  • Press green flag
  • Click the "play" sprite
  • Note the falling ball stops when it hits the left-most platform or the black floor strip
  • View project 161606350 in 3.0
  • Press green flag
  • Click the "play" sprite
  • Note the falling ball doesn't stop until it gets to the bottom of the screen

Operating System and Browser

Kim: _Firefox 53.0.3 (32-bit), Windows 10; verified on other computers_
@jwzimmer (repro): _Mac OS, Chrome Version 58.0.3029.110 (64-bit)_

help wanted

All 5 comments

ball falls through floor

You might say we... dropped the ball?...

The touching-color bug described here is related to https://github.com/LLK/scratch-gui/issues/423. Thanks. :)

@cwillisf it looks like the relevant threshold is here? I'm not sure, but that comment looks suggestive https://github.com/LLK/scratch-flash/blob/9fbac92ef3d09ceca0c0782f8a08deaa79e4df69/src/scratch/ScratchStage.as#L655

Hmm, the mask in Scratch 2.0 looks at the top 5 bits of red and green, but only the top four bits of blue?

var mask:uint = 0x00F8F8F0;

https://llk.github.io/scratch-gui/#161606350 relies on the extra blue tolerance. The lines are drawn with #000000 but the code checks for #00000d.

color-threshold

If I change all instances of #00000d -> #000000 the game works (except for level backdrop9 which doesn't seem to be passable in 3.0).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thisandagain picture thisandagain  路  4Comments

kyleplo picture kyleplo  路  3Comments

Richienb picture Richienb  路  3Comments

ntlrsk picture ntlrsk  路  3Comments

rschamp picture rschamp  路  3Comments