Commit graph

386 commits

Author SHA1 Message Date
TheBrokenRail
40b530fa7e Offline Support [READY TO MERGE?] [ALONG WITH THE SCRATCH-RENDER PR] (#138)
* Remove Fallback Project

* Added A Newline and Removed Fallback Project

* Made The SB2 Project Import Field Fit In  More With All Other Textboxes

* Better Description Of SB2 Import Field

* Oops!

* The XML Import Area Doses Not Need To Be Resizable!

* That Didn't Work As Planned

* Now it won't rezize

* Added SB3New

* Add Code For SB3New

* Better 404

* Indentation

* NodeJS complains about quotes

* Moved And Renamed SB3New

* Renamed Refrences

* Prefix With ./

* Typo

* Newline Fix

* Scratch Cat By Default!

* Single Quotes And Max Legth Fixed

* Better Comment Above loadProject

* Move newProject to index.js

* Added Dependincies to index.js

* Deleted newProject.js

* Removed Unneeeded Semicolon

* @param {?string}

* Added SVG For Scxratch Cat

* Now Uses Scratch Cat Offline (REQUIRES PULL REQUEST MADE TO SCRATCH-RENDER TO BE MERGED OR IT WILL NOT WORK)

* Added Stage PNG

* Added Stage Creation

* Fix Sizing Issues

* Import And Compatibility With Less Hacky Image Import (Scratch-Render)

* Import And Compatibility With Less Hacky Image Import (Scratch-Render)

* Fixed Line Length

* Added Navigation Bar

* Added CSS For Drop Down Menus

* Nicer Scale

* Nicer Dropdowns

* Remobved Dropdown CSS (It Didn't Work)

* Add Scratch Player Bar CSS

* Add Scratch Player Bar HTML
2016-09-12 11:05:16 -04:00
Tim Mickel
d93eeed05d More color utilities, touching color, color touching color (#155)
* Fill out color utilities

* Amend Color.decimalToHex name

* Add `Cast.toScaledRgbColor`

* Add touching color, color touching color blocks

* Fix scale of Cast.toRgbColor

* Fix format of colors to use renderer-style lists

* Update `Color.decimalToRgb`

* Lint self
2016-09-12 10:58:50 -04:00
Tim Mickel
5df0acc895 Better glows (#152)
* Strip out old script glowing in thread management

* Add new tracking mechanism for glowing scripts

* Track parents and use them to determine script glows

* Use top-block for a thread if there's nothing on the stack

* Remove `console.log`
2016-09-08 09:40:53 -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
Tim Mickel
14feb64005 Create a new input if one doesn't exist (#148)
* Create a new input if one doesn't exist

* Add regression tests for move-into-empty and obscuring shadows via move
2016-09-08 09:40:01 -04:00
Eric Rosenbaum
7709a4095e first working audio engine using audioworker 2016-09-07 16:55:38 -04:00
Tim Mickel
f7e339f7c2 Remove uppercase from keyboard hat activators 2016-09-07 16:00:22 -04:00
Tim Mickel
3fcd70a802 KEY_OPTIONS -> KEY_OPTION 2016-09-07 15:57:53 -04:00
Eric Rosenbaum
6d21890338 Merge remote-tracking branch 'LLK/develop' into develop 2016-09-06 12:55:19 -04:00
Eric Rosenbaum
8bf2949eea play note block uses scale degree input 2016-09-06 12:54:58 -04:00
Tim Mickel
3dbfc3fdb6 Tweaks from SB2 importer audit (#137)
* Fix SB2 variable imports!

* Fix expectedArg field types

* motion_pointindirection uses math_angle

* Fix "think for secs" expected input

* Add handling for empty input case (empty if-else, for example)

* Fix opcodes for if_else, repeat_until, set tempo

* Specialized number fields for SB2 import

* Convert color picker numbers to hex in SB2 import

* KEY_OPTIONS -> KEY_OPTION

* Backdrop blocks get BACKDROP

* Update toolbox XML to match naming changes

* Merge in math_angle case

* Move color converter to its own utility

* Fix merge conflicts

* Add negative color check.

* Fix keyoptions naming

* Pen JSON tweak post-scratch-blocks update
2016-09-06 11:46:10 -04:00
Tim Mickel
9a8b68643a Shadow improvements (#135)
* Always add `next` to block representation

* Add `shadow` property to inputs, to maintain obscured shadows

* Create obscured shadows in SB2 import

* Add XML import of obscured shadows

* Alias SB2 shadow inputs to block inputs

* Add shadow to inputs on "delete inputs" test

* Add a small test to ensure obscured shadows are preserved

* Add more obscured shadow tests
2016-09-06 10:55:52 -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
e831866789 Keyboard events, "key is down" reporter (#117)
* Keyboard events, "key is down" reporter

* Update comment about inputs

* Simplify/generalize keyMap into a keys-pressed list

* Cast values passed to scratchKeyToKeyCode appropriately.

* Cut unspaced key values

* Fix lint from merge commit
2016-09-02 11:23:09 -04:00
Tim Mickel
86f136dd10 Merge pull request #115 from tmickel/feature/2.0-loader
Start of a 2.0 project loader
2016-09-02 11:16:35 -04:00
Tim Mickel
77d0376b15 Merge pull request #107 from tmickel/feature/hats
Hat blocks
2016-09-02 11:12:07 -04:00
Tim Mickel
ae89cfbb6b Comment nit 2016-09-02 09:47:27 -04:00
liam4
1437a358e1
getDay is zero-based where Sunday = 0; Sunday should be 1 2016-09-02 10:20:54 -03:00
liam4
602cb47a1e
Remove unused util variable 2016-09-02 01:01:17 -03:00
liam4
f981e8747f
Implement 'current' block 2016-09-02 00:48:14 -03:00
Tim Mickel
c70e9759a9 Add initial SB2 importer and spec map 2016-08-31 13:56:05 -04:00
Tim Mickel
3e749fb9f1 Add loadProject, setEditingTarget, and UI emits 2016-08-31 12:28:09 -04:00
Tim Mickel
23d9999a9f Add runtime.getTargetById helper 2016-08-31 12:18:24 -04:00
Tim Mickel
d4a43639f3 Add editingTarget and map block events to that target 2016-08-31 12:08:54 -04:00
Tim Mickel
08f48c5b30 Always start runtime with an empty target list. 2016-08-31 12:03:41 -04:00
Tim Mickel
ba0cc0dcfc Pass along newCoordinate of Blockly MOVE events 2016-08-31 11:50:29 -04:00
Tim Mickel
ad82a5cb74 Add naming mechanism for targets/clones 2016-08-31 11:50:10 -04:00
Tim Mickel
2c6722b958 Add unique ID for Targets 2016-08-31 11:39:57 -04:00
Tim Mickel
b1a3026ea1 Blockly XML encoding for Blocks object
Provide two functions, `toXML` and `blockToXML`, which can be used to generate workspaces based on the VM representation of the blocks.
2016-08-31 11:38:45 -04:00
Tim Mickel
c58bda1839 Record coordinate changes in block representation 2016-08-31 11:34:29 -04:00
Tim Mickel
05a5369d7b Switch Blockly listener to normal function (not closure/generated) 2016-08-31 11:34:17 -04:00
Tim Mickel
aa70c1bc3b Add shadow, x, y properties to block adapter 2016-08-31 11:32:59 -04:00
Tim Mickel
8339e2769f Clean up and add documentation to sprite/clone 2016-08-31 11:30:09 -04:00
Tim Mickel
2da121d019 Add UID utility 2016-08-31 11:21:42 -04:00
Tim Mickel
be06078df1 Update sprite and clones to have basic costume support 2016-08-31 11:21:32 -04:00
Tim Mickel
bdc95cffc0 Rename trigger->activate/start 2016-08-29 10:26:26 -04:00
Tim Mickel
1098a06985 Various renames for hat opcodes/top blocks, allScriptsDo 2016-08-29 10:18:49 -04:00
Tim Mickel
3ccfdf3df0 Use hasOwnProperty in getIsHat/getIsEdgeTriggeredHat 2016-08-29 10:03:21 -04:00
Tim Mickel
40c90bbcc7 Add isActiveThread and simplify broadcast-and-wait accordingly 2016-08-29 10:01:31 -04:00
Tim Mickel
64b82f4dc2 Switch back j->i 2016-08-29 09:52:34 -04:00
Tim Mickel
29887e24c9 Simplify execute hat check.
In case a reporter has side-effects, we'd probably like to run hat predicates even if there is no next block.
2016-08-24 11:04:23 -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
b4cf64009f General-purpose hat implementation 2016-08-23 18:12:32 -04:00
Tim Mickel
39fdbaf983 Add atStackTop helper to Thread 2016-08-23 18:12:19 -04:00
Tim Mickel
43f3b59f7c Add retireThread to seqeuencer 2016-08-23 15:53:34 -04:00
Tim Mickel
94e389c8fb Refactor script glowing into its own runtime function 2016-08-23 15:47:21 -04:00
Eric Rosenbaum
5e268d57d3 scale to midi note reporter 2016-08-17 16:45:01 -04:00
Eric Rosenbaum
f8e460f1b4 fixing quantize unit again 2016-08-17 12:45:06 -04:00
Eric Rosenbaum
911a8fa02e fixing quantize unit (oops) 2016-08-17 11:45:58 -04:00
Eric Rosenbaum
fee8f61079 removing attempted quantization 2016-08-17 11:38:01 -04:00
Eric Rosenbaum
d121a4c6fa Merge remote-tracking branch 'LLK/develop' into develop
# Conflicts:
#	src/engine/runtime.js
2016-08-16 16:41:36 -04:00
Eric Rosenbaum
d5e46535e8 playing with quantization 2016-08-16 16:32:35 -04:00
Eric Rosenbaum
27184762bd fixed panner 2016-08-16 12:04:24 -04:00
Tim Mickel
aebcfde492 Add VM "I/O devices", clock, mouse as demo 2016-08-15 21:37:36 -04:00
Tim Mickel
349cb14c5a Removing extra cast in join implementation 2016-08-11 19:00:11 -04:00
Tim Mickel
bfe007e29f Add casting utilities and apply them to operator blocks 2016-08-11 18:47:55 -04:00
Tim Mickel
07e965261d Implementation of remaining operators 2016-08-11 18:47:55 -04:00
Eric Rosenbaum
8c40e9c383 play sound, play drum and audio effects experiments 2016-08-11 16:47:01 -04:00
Tim Mickel
4faaf1b685 Rename stacks to scripts
Further pushing toward removing ambiguity of what "stack" means in the codebase.
2016-08-11 11:11:27 -04:00
Tim Mickel
7780b25c46 Project wide rename substack -> branch 2016-08-10 11:43:49 -04:00
Eric Rosenbaum
951d7771f3 tonejs synth for play note blocks 2016-08-09 15:40:50 -04:00
Andrew Sliwinski
32c691d404 Merge branch 'develop' of github.com:LLK/scratch-vm into bugfix/2 2016-08-09 09:26:31 -04:00
Tim Mickel
2c031d87f6 Make renderer/self nullable in the Clone
Fixes a test issue where renderer is not necessarily defined.
2016-08-08 18:29:44 -04:00
Andrew Sliwinski
32b1d4ec61 Remove memoizee dependency and usage in adapter. Resolves GH-2 2016-08-08 17:07:50 -04:00
Tim Mickel
67c3ceff86 Update clone's scale to match renderer update 2016-08-08 16:47:52 -04:00
Tim Mickel
a6ad34f002 Add primitive for math_angle, fixing point in direction 2016-08-08 16:44:48 -04:00
Tim Mickel
0b826c0dc9 Remove unused Promise in scratch3_operators 2016-08-08 15:44:55 -04:00
Tim Mickel
c47a061edb Updates for newly released scratch-render repo 2016-08-08 15:43:52 -04:00
Tim Mickel
c650de8520 Real version of Clone.prototype.setVisible 2016-07-13 16:52:46 -04:00
Tim Mickel
1f19d7a209 Only visually report when an actual value was returned 2016-07-07 19:44:26 -04:00
Tim Mickel
9c6dca8131 Add visual reporting of top-level reporter execution 2016-07-07 19:42:38 -04:00
Tim Mickel
d4353458ff Don't quit loop when a thread is yielding 2016-07-06 14:16:44 -04:00
Tim Mickel
30dc285a37 Add implementations for math_positive_number and math_whole_number 2016-07-06 14:13:03 -04:00
Tim Mickel
7c24bdc612 More documentation in sprite, clone 2016-07-06 14:09:06 -04:00
Tim Mickel
2e01caa8a6 Add documentation for math-util functions. 2016-07-06 14:04:36 -04:00
Tim Mickel
798368b6c5 Add documentation in src/sprites/clone.js 2016-07-06 13:57:58 -04:00
Tim Mickel
460760bd06 Stub "say" and "think" blocks with console.log 2016-07-06 13:47:32 -04:00
Tim Mickel
0ae0ea5f22 Run threads for 60fps 2016-07-01 16:30:33 -04:00
Tim Mickel
ce941c6fd8 Add show/hide blocks using ghost effect as backend 2016-07-01 12:56:59 -04:00
Tim Mickel
6891a3a5dd Add direction reporter 2016-07-01 12:56:45 -04:00
Tim Mickel
660029010d Feed in requestAnimationFrame events to VM
Not sure exactly how to use these yet, but it seems helpful to have them in there.
2016-07-01 11:52:43 -04:00
Tim Mickel
bb68fcab25 Additional fix for repeat's executedInFrame 2016-07-01 11:41:52 -04:00
Tim Mickel
57217f0044 Rename executed in repeat, ifElse 2016-07-01 11:29:32 -04:00
Tim Mickel
ad30fa8059 Temporarily remove per-block glow 2016-07-01 11:27:01 -04:00
Tim Mickel
e4f6c9e90c "Repeat until" implementation 2016-07-01 11:25:26 -04:00
Tim Mickel
dda4fc8332 Yield frame on an empty substack 2016-07-01 11:24:06 -04:00
Tim Mickel
39c71b559d Update repeat implementation to execute once per frame 2016-07-01 10:50:31 -04:00
Tim Mickel
de6ba08866 Add single-frame yield mode 2016-07-01 10:44:43 -04:00
Tim Mickel
5876681bc7 Version of random that truncates ints 2016-07-01 10:28:47 -04:00
Tim Mickel
bb5acd1ef4 Fix merge issue in execute.js 2016-06-30 19:01:19 -04:00
Tim Mickel
1eaed6fff3 Implement graphic effects and size blocks 2016-06-30 18:59:47 -04:00
Tim Mickel
7db2981ddc Add additional motion block implementations 2016-06-30 18:59:47 -04:00
Tim Mickel
42f0f66acd Implement move steps, turn right, turn left, point in direction 2016-06-30 18:59:47 -04:00
Tim Mickel
727d2c0d23 Clamp clone direction like Scratch 2.0 2016-06-30 18:59:47 -04:00
Tim Mickel
7db38e8422 Implement a few math utilities 2016-06-30 18:59:47 -04:00
Tim Mickel
19da0b0032 Add renderer demo using scratch-render-webgl 2016-06-30 18:59:47 -04:00
Tim Mickel
809528abdc Straw-man implementation of targets/sprites/clones 2016-06-30 18:59:17 -04:00
Tim Mickel
1c24770f8c Remove debug calls from execute 2016-06-30 18:56:31 -04:00
Tim Mickel
ec4567aa8a Simplify logic for Thread status 2016-06-30 18:56:31 -04:00
Tim Mickel
ab6e0d3839 Remove YieldTimers, unused WeDo blocks 2016-06-30 18:56:31 -04:00
Tim Mickel
6daee9a70e Remove VM-locking yield mode per discussion 2016-06-30 18:56:23 -04:00
Tim Mickel
9a7ab57f6f Always yield thread when a promise is returned. 2016-06-30 18:56:23 -04:00
Tim Mickel
9881ee76b9 Deal with promise rejection also. 2016-06-30 18:56:23 -04:00
Tim Mickel
57057bfffc Remove unused require to fix build 2016-06-30 18:56:23 -04:00
Tim Mickel
d72cc55c11 Example that uses promises instead of util.report 2016-06-30 18:56:23 -04:00
Tim Mickel
8f6a88c095 Ensure predicates always return booleans 2016-06-30 18:56:23 -04:00
Tim Mickel
09b9c506a9 Check for blocking case in stepToReporter 2016-06-30 18:56:23 -04:00
Tim Mickel
405ad1044e getBlockingThread_ returns null when none available. 2016-06-30 18:56:23 -04:00
Tim Mickel
d44b806b4f Add blocking yield mode 2016-06-30 18:56:23 -04:00
Tim Mickel
c63747e61b Move stepping logic for reporters to sequencer 2016-06-30 18:56:23 -04:00
Tim Mickel
f802faa461 operator_not in primitive table 2016-06-30 18:56:23 -04:00
Tim Mickel
f210c12d4d Add more operators for testing 2016-06-30 18:56:23 -04:00
Tim Mickel
e56c6e6980 Rename primitiveReturnValue -> primitiveReportedValue 2016-06-30 18:56:23 -04:00
Tim Mickel
e83cfa6049 Add comment and clear currentStackFrame.reported 2016-06-30 18:56:23 -04:00
Tim Mickel
9d9749681b Comment and else for reporter finishes right away 2016-06-30 18:56:23 -04:00
Tim Mickel
b21c9edf04 Commenting improvements 2016-06-30 18:56:23 -04:00
Tim Mickel
173f0615d3 Refactor: always push reports to the stack frame 2016-06-30 18:56:23 -04:00
Tim Mickel
6181bcd5cb Refactor Thread.peekParentStackFrame 2016-06-30 18:56:23 -04:00
Tim Mickel
bed3e28c02 Simplifications of execute ordering
and always cache returned reporter values in currentStackFrame.reported.
2016-06-30 18:56:23 -04:00
Tim Mickel
d15c93af05 Keep "waiting reporter name" on the stack frame.
Also add highlighting for inputs.
2016-06-30 18:56:23 -04:00
Tim Mickel
7ef3807b18 Example of a yielding reporter (returns random number after 1s) 2016-06-30 18:56:23 -04:00
Tim Mickel
97f7571c6f Prototype implementation of yielding reporters 2016-06-30 18:56:23 -04:00
Tim Mickel
190208b620 Clean up yield-timers: support multiple, move logic to Threads. 2016-06-30 18:56:23 -04:00
Tim Mickel
b97974e2ac Implement WebWorker interface 2016-06-21 15:30:27 -04:00
Tim Mickel
783a3688aa Update index.js to support worker environment 2016-06-21 14:48:54 -04:00
Tim Mickel
652cc8a31c Fix references to window 2016-06-21 14:29:40 -04:00
Tim Mickel
28432b6f01 Merge pull request #81 from tmickel/feature/update-playground-june-14
Update playground and block implementations to match scratch-blocks
2016-06-17 11:55:44 -04:00
Tim Mickel
695d0bd7fd Merge pull request #80 from tmickel/bugfix/empty-fields
Handling empty fields
2016-06-17 11:46:36 -04:00
Tim Mickel
7427fe4ff3 Add fix for adapter to deal with empty fields 2016-06-14 18:14:04 -04:00
Tim Mickel
a1be1d6566 Update playground and block implementations to match scratch-blocks 2016-06-14 18:08:41 -04:00
Tim Mickel
056fb76492 Remove try/catch in execution - fix #75 2016-06-13 11:23:39 -04:00
Tim Mickel
a58fa43572 Add reset to numYieldingThreads and comment about YieldTimers 2016-06-10 13:38:35 -04:00
Tim Mickel
e9eb7c6e57 Remove leftover console.groupEnds in execute 2016-06-10 13:34:07 -04:00
Tim Mickel
0bf9ab59a1 Add implementation for ifElse 2016-06-10 10:40:15 -04:00
Tim Mickel
ca68c55d57 Implement logic_equals, if blocks 2016-06-10 10:36:05 -04:00
Tim Mickel
506e9c32be Don't attempt to glow a block that isn't known in the VM 2016-06-10 08:48:39 -04:00
Tim Mickel
7cc0c00da6 Correctly deal with empty substacks.
The stack needs to be popped in this situation.
2016-06-10 08:47:54 -04:00
Tim Mickel
559a2a0fab Remove redundant piece of code
The stack is pushed in after the thread finishes (`proceedThread`).
2016-06-10 08:41:44 -04:00
Tim Mickel
526a260101 Simplify execution by removing nextBlock
Everything is managed by the stack, including what the execute() function does.
2016-06-09 17:08:30 -04:00
Tim Mickel
2cd6bf93bb Fix argument for repeat block 2016-06-09 17:05:08 -04:00
Tim Mickel
d52938c255 Bind thread.yield passed to primitive to actual thread 2016-06-09 15:06:24 -04:00
Tim Mickel
27064ce163 Fix implementation of "wait" block 2016-06-09 15:06:11 -04:00
Tim Mickel
88402ee68c Move popStack to inside execute 2016-06-09 14:45:54 -04:00
Tim Mickel
b0441e2ef5 Implement stub for number and add blocks 2016-06-09 14:29:07 -04:00
Tim Mickel
a987d9d9cc Only include field value in execute.argValues 2016-06-09 14:27:11 -04:00
Tim Mickel
bcd058bdc4 Disable unimplemented broadcast block 2016-06-09 14:23:45 -04:00
Tim Mickel
c21700380f Pull sequencer-related callbacks out of execute 2016-06-09 14:23:34 -04:00
Tim Mickel
9df470255e Add helpers to thread object 2016-06-09 14:22:58 -04:00
Tim Mickel
1d16a97115 Recursive evaluation for block arguments 2016-06-09 13:28:50 -04:00
Tim Mickel
c4517a451b Add isInput execution property to avoid proceeding the thread 2016-06-09 13:28:06 -04:00
Tim Mickel
6e5ebcf6df Split execution into separate function and file 2016-06-09 13:27:30 -04:00
Tim Mickel
3898fe1c45 Instrument blocks.js with getters for fields and inputs 2016-06-09 13:26:07 -04:00
Tim Mickel
bd7f3245a2 Move scratch3 blocks into separate packages. 2016-06-09 11:45:58 -04:00
Tim Mickel
b9bd037963 Fixing eslint JSDoc from merge 2016-06-08 17:25:26 -04:00
Tim Mickel
42d03db28b Merge branch 'develop' into feature/eslint-jsdoc
# Conflicts:
#	.eslintrc
#	src/index.js
2016-06-08 17:23:41 -04:00
Tim Mickel
d17ffbb99b Merge pull request #60 from tmickel/feature/vm-playground-execution
Instrument VM and playground for better execution debugging
2016-06-08 17:15:36 -04:00
Tim Mickel
1f1a4941f3 Add .eslintrc rule to check JSDoc syntax
And fix the broken syntax rules
2016-06-08 16:57:08 -04:00
Tim Mickel
7a42e9ae68 Move blockListener to blocks.js; combine flyout listener 2016-06-08 13:44:09 -04:00
Tim Mickel
8fa29bc6de Spacing fix in blocks.js 2016-06-08 13:27:01 -04:00
Tim Mickel
c1e30cf2ee Add sequencer-level debug console logs 2016-06-07 21:05:32 -04:00
Tim Mickel
5767e05d56 Add block-by-block feedback to the VM playground 2016-06-07 20:59:34 -04:00
Tim Mickel
2be27cbc7d Merge pull request #57 from tmickel/feature/full-tree
Update for VM block management
2016-06-07 13:27:41 -04:00
Tim Mickel
2339c5e710 Additional tests for invalid adapter inputs 2016-06-07 12:01:47 -04:00
Tim Mickel
3b4a00ce46 Add check for null substackNum, fix numbering 2016-06-07 11:32:29 -04:00
Tim Mickel
f158af18b1 Case problem with blocks.js in index.js 2016-06-06 16:19:57 -04:00
Tim Mickel
fd95d3045d Fix property check of topLevel in createBlock 2016-06-06 15:58:54 -04:00
Tim Mickel
f63e261892 Remove breaking check for blockId 2016-06-06 15:58:40 -04:00
Tim Mickel
0efe7e2b27 Fix block events for flyout blocks 2016-06-06 15:44:13 -04:00
Tim Mickel
dbb31462ad Extend getSubstack to support multiple substacks 2016-06-06 15:31:14 -04:00
Tim Mickel
9be33089a8 Refactor block management into a separate module. 2016-06-06 15:29:34 -04:00
Tim Mickel
25c3a38c16 Allow top-level creation of shadow blocks in adapter 2016-06-06 14:57:58 -04:00
Tim Mickel
aa152fd604 Rewrite of moveBlock to better reflect Blockly 2016-06-06 14:55:01 -04:00
Tim Mickel
214daa8087 Always unset topLevel in deleteStack_
Blocks may have topLevel set even if they are not present in this.stacks
2016-06-06 14:54:32 -04:00
Tim Mickel
18e4228399 Update runtime's handling of delete for new blocks structure 2016-06-06 14:53:59 -04:00
Tim Mickel
285c2792ef Only add to stacks if topLevel is true in CREATE 2016-06-06 14:53:42 -04:00
Tim Mickel
e5b677c7f6 Fix naming of MOVE event in index.js 2016-06-06 14:53:27 -04:00
Tim Mickel
9fef9d7edd Fix up adapter's domToBlock 2016-06-06 14:44:51 -04:00
Tim Mickel
0dfc72893c Update Runtime createBlock for new structure; _addStack helper. 2016-06-06 14:12:43 -04:00
Tim Mickel
b28c50e6a5 Rewrite of adapter to support trees of blocks, inputs 2016-06-06 14:09:27 -04:00
Tim Mickel
9ce3783940 Fix handling of stack click
Previously was improperly reading `e.type`.
2016-06-01 13:48:54 -04:00
Tim Mickel
cfed4e1bba Add "stack click" event handler to VM
See: https://github.com/LLK/scratch-blocks/pull/360
2016-06-01 10:26:06 -04:00
Tim Mickel
4d4682912d Resolve existing motor timeout (instead of reject) 2016-05-09 14:18:33 -04:00
Tim Mickel
dd53b86b8c Reduce amount of time for executing blocks 2016-05-05 13:09:37 -04:00
Andrew Sliwinski
0de30986aa Switch WeDo2 led block to use color index rather than absolute RGB values. 2016-05-05 08:33:44 -04:00
Tim Mickel
5c03167ec3 Hack helper for distance sensors 2016-05-03 17:39:02 -04:00
Tim Mickel
85f8e99ca8 Add delay to RGB block 2016-05-03 17:23:59 -04:00
Tim Mickel
659c9b274a Add motorStop patch to stopAll 2016-05-03 17:18:28 -04:00
Tim Mickel
79b50e5172 Remove block glows from sequencer 2016-05-03 17:18:21 -04:00
Tim Mickel
833f40cfe5 Allow pushing threads that are not on this.stacks
For flyout running
2016-05-03 15:58:20 -04:00
Tim Mickel
9363432456 Hacked implementation of broadcasts 2016-05-03 14:57:10 -04:00
Tim Mickel
beebae0d2e Implement stop block
Using a call to the runtime.
2016-05-03 14:39:33 -04:00
Tim Mickel
5f5fe6fafd Fix to check if block still exists 2016-05-03 14:35:02 -04:00
Tim Mickel
6b1eb6df51 Control blocks argValues 2016-05-03 14:26:43 -04:00
Tim Mickel
17d4485695 Fix WeDo args 2016-05-03 14:25:19 -04:00
Tim Mickel
8facd64376 Hack for getting argument values 2016-05-03 14:25:12 -04:00
Tim Mickel
90a5982ff9 Fix Runtime.stopAll
Removing threads as we were looping was causing not all of them to be hit.
2016-05-03 14:11:37 -04:00
Tim Mickel
5b834667eb Merge pull request #19 from tmickel/feature/repeats
Stacks management, stack frames, repeat, forever
2016-05-03 14:04:50 -04:00
Tim Mickel
548d95b765 Fix attempt to pop from the stack
-Keeps it in newThreads
-Update thread status to STATUS_RUNNING to keep it going
2016-05-03 13:53:52 -04:00