Paul Kaplan
2c7de6380e
Add implementation for "When loudness >" block
2018-07-05 09:42:00 -04:00
Ray Schamp
f5234c777a
Merge pull request #1211 from mzgoddard/broadcast-and-wait-promise
...
yield a tick if broadcastandwait is waiting on threads waiting for a future tick
2018-06-13 15:58:37 -04:00
Michael "Z" Goddard
d161251a9b
yield a thread loop or tick in event_broadcastandwait
...
- yield a thread loop or tick in looks_switchbackdroptoandwait
If all threads broadcastAndWait is watching are "waiting" for a future
frame, yield until the next tick so event_broadcastandwait also defers
to a future frame.
2018-06-12 10:02:28 -04:00
Eric Rosenbaum
db7c56e08b
Change function name and comment for clarity
2018-06-07 14:12:23 -04:00
Eric Rosenbaum
1a72512a62
Moving touchingObject into rendered target
2018-06-06 16:34:58 -04:00
Eric Rosenbaum
431d4bd66b
Add when touching hat
2018-06-06 13:39:23 -04:00
Eric Rosenbaum
508ac91b82
Runtime emits key pressed event
2018-05-22 17:24:22 -04:00
Paul Kaplan
140094a7ad
Make "when clicked" blocks target dependent.
...
This involves adding a new opcode, event_whenstageclicked, and adding a
method to the blocks container to update the opcode pair depending on
whether the target is the stage. This method is then called in two
places: first after the sb2 import parses the blocks (not done in the
sb2 parsing itself because no other blocks are target specific) and then
again when blocks are shared between targets.
Also added tests for the block container method, and a fixture project
that tests the opcode splitting on sb2 import.
2018-03-20 10:41:50 -04:00
Karishma Chadha
34b0aff637
Bugfix for scratch-gui issue #994 , where executing a broadcast block from the flyout was creating a conflicting variable, causing a fatal error.
2017-12-04 18:01:29 -05:00
Karishma Chadha
b674a0c047
Code cleanup and refactoring, and getting scratch3_event broadcast functionality to look up the variable name instead of getting it ad-hoc.
2017-11-28 22:33:27 -05:00
Karishma Chadha
0a15190b85
Broadcast message functionality (works with creating new messages, and switching back and forth between them as well). This commit includes a temporary workaround for the issue where the default broadcast message, 'message1' wasn't triggering a var_create event (filed in LLK/scratch-blocks#1258 ).
2017-11-21 16:48:48 -05:00
Ray Schamp
a4f095db5e
Use ES6 style classes
2017-04-17 19:42:48 -04:00
Ray Schamp
e01c4ae108
Pass with --fix
2017-04-17 15:10:04 -04:00
Ray Schamp
727fcc7875
Lint for eslint-config-scratch@3
2017-02-01 16:27:55 -05:00
Ray Schamp
7712b2902f
Fix quote-props
2016-10-24 11:02:19 -04:00
Ray Schamp
f6c0064235
All linting other than console statements
2016-10-23 22:20:29 -04:00
Ray Schamp
68ed110b49
Pass with eslint --fix
...
Resolved whitespace issues, e.g., space-before-function-paren and key-spacing
2016-10-23 12:41:45 -04:00
Tim Mickel
e49f076fa1
Interpreter fixes, enhancements, features ( #280 )
...
* Thread stepping rework; interp.redraw equivalent
* Add turbo mode and pause mode
* Yielding behavior to match Scratch 2.0
* Implement warp-mode procedure threads
* Add check for recursive call
* Inline wait block timer
* Revert to setInterval and always drawing
* Restore yielding in glide
* 30TPS compatibility mode
* 5-call count recursion limit
* Removing dead primitive code
* To simplify, access runtime.threads inline in `stepThreads`.
* Warp mode/timer fixes; recursive check fixes; clean-up
* Add basic single-stepping
* Add single-stepping speed slider
* Allow yielding threads to run in single-stepping
* Restore inactive threads tracking for block glows
* Add clock pausing during pause mode
* Documentation and clean-up throughout
* Don't look for block glows in `thread.topBlock`.
* Add null check for block glows; rename `_updateScriptGlows` to reflect block glowing
* Use the current executed block for glow, instead of stack
* Add more comments to `stepToProcedure`, and re-arrange to match 2.0
* Tweak to Blocks.prototype.getTopLevelScript
* Revert previous
* Fix threads array to be resilient to changes during `stepThreads`
* Restore inactive threads filtering
* Fix typo in "procedure"
* !! instead of == true
2016-10-17 23:23:16 -04:00
Tim Mickel
bbea1af5a3
Better shadow evaluation ( #160 )
...
* Better shadow evaluation
* Audit and improve casting for all primitives
* Force repeat times to int
* Remove colorPicker shadow menu
2016-09-12 13:14:16 -04:00
Tim Mickel
797f844de3
Stage, costumes, backdrops ( #149 )
...
* Add `Clone.prototype.getCostumeIndexByName`, keep in range
* Add basic costume primitives from Scratch 2.0
* Add costume getter block
* Add properties and methods for distinguishing stage and sprites-vs-clones
* Add backdrop-related looks blocks
* Fix up "switch to backdrop" to be working
* Costume/backdrop reporters are 1-indexed
* Fire "when backdrop switched" hats
* Cut cloning helpers for a separate PR
* Disable many blocks on the stage
* Refactor into _setCostumeOrBackdrop; implement switch backdrop and wait
* Fire hats even when backdrop unchanged
2016-09-08 09:40:27 -04:00
dekrain
7caf8e588a
More hats ( #143 )
...
* Key pressed hat
* Tabs -> Spaces
* Oops
* Edge activate
* Fix hat
Phew...
* I forgot to change it also here
:/ :/ :\
* Minor fixes for TravisCi
* Minor docs
* Line length
2016-09-03 16:33:45 -04:00
Tim Mickel
bdc95cffc0
Rename trigger->activate/start
2016-08-29 10:26:26 -04:00
Tim Mickel
40c90bbcc7
Add isActiveThread
and simplify broadcast-and-wait accordingly
2016-08-29 10:01:31 -04:00
Tim Mickel
4f81033762
Remove extra Thread require
2016-08-23 18:46:54 -04:00
Tim Mickel
4f2cccf279
Fix issue when broadcasting in a when-broadcast
2016-08-23 18:37:03 -04:00
Tim Mickel
fe2ba2a536
Implementation of timer > _, broadcast, broadcast and wait
2016-08-23 18:14:05 -04:00
Tim Mickel
bcd058bdc4
Disable unimplemented broadcast block
2016-06-09 14:23:45 -04:00
Tim Mickel
bd7f3245a2
Move scratch3 blocks into separate packages.
2016-06-09 11:45:58 -04:00