Commit Graph
201 Commits
Author SHA1 Message Date
Michael "Z" Goddard cd7e03f0f6 Merge pull request #1019 from mzgoddard/motion-detect-3
Test VideoMotion and VideoSensing blocks
2018-04-10 13:06:58 -04:00
kchadha d177f4cd0c Merge pull request #1033 from towerofnix/counter-vm
Implement counter blocks
2018-04-09 13:55:35 -04:00
kchadha b794e19c31 Merge pull request #1032 from towerofnix/while-vm
Implement "while" block
2018-04-09 13:48:08 -04:00
Florrie 797d16be26 Implement counter blocks 2018-04-07 16:02:49 -03:00
Florrie 466a3b62ef Add test for repeatWhile 2018-04-07 14:07:15 -03:00
Michael "Z" Goddard d3ff8b5eed Test VideoMotion and VideoSensing blocks
- Add pngjs dev dependency to read test images
2018-04-06 18:09:50 -04:00
Eric Rosenbaum 25f1c1a5e6 Merge pull request #1017 from ericrosenbaum/bugfix/clones-inherit-instrument
Clones inherit music custom state
2018-04-06 13:38:03 -04:00
kchadha 4b62a938c4 Merge pull request #1000 from kchadha/deserialize-assets-in-sb2
Deserialize sb2 assets while loading local .sb2.
2018-04-06 11:33:00 -04:00
Eric Rosenbaum 2a90e5868d Fix runtime scope and unit test 2018-04-05 15:01:52 -04:00
Karishma Chadha b2a4f563a0 Pull JSON.parse into extractProjectJson function. 2018-04-05 13:58:45 -04:00
Karishma Chadha 6c2838e8f4 Renaming file reading/extracting functions in tests. 2018-04-05 13:46:07 -04:00
Paul Kaplan 2d9bd92140 Merge pull request #930 from ericrosenbaum/bugfix/loudness-performance
Only measure loudness once per step
2018-03-29 16:27:10 -04:00
kchadha 51306e3492 Merge pull request #963 from towerofnix/foreach-vm
Implement for-each block
2018-03-28 10:52:14 -04:00
Florrie 307a48da5a Remove tests for old behavior 2018-03-28 11:38:19 -03:00
Karishma Chadha 1511fa79e3 Update tests to allow parsing whole .sb2s 2018-03-25 19:08:52 -04:00
kchadha dbc7b9597f Merge pull request #979 from kchadha/serialization-cleanup
SB3 Serialization & Load Project
2018-03-23 10:11:49 -04:00
Karishma Chadha 2c3e3472ed Add warning to 'fromJSON' function since it is now just a wrapper around loadProject. Change vm sb3_serialization test to use 'loadProject' function instead of 'fromJSON'. 2018-03-21 17:55:02 -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 b4f6f24926 Fix up tests. 2018-03-16 11:43:27 -04:00
Florrie a03f45d1d7 Add tests for forEach block 2018-03-05 16:18:09 -04:00
DD b885402081 Merge branch 'develop' into privateSprite 2018-03-01 17:27:10 -05:00
Eric Rosenbaum 5d658b5ecb Merge pull request #953 from ericrosenbaum/bugfix/load-tempo-from-sb2
Load tempo from sb2
2018-03-01 13:20:37 -05:00
Eric Rosenbaum a0525542fc Stub runtime to fix unit test 2018-02-27 15:38:34 -05:00
Karishma Chadha 8c5c68b896 Duplicating sprite should give new sprite a fresh name. 2018-02-26 23:17:25 -05:00
DD b4d6db0ad9 Fix tests 2018-02-22 15:45:41 -05:00
DD 729fc3d303 Make sprite.costumes private so that I can enforce that when you add costumes, they get assigned a unique ID 2018-02-21 19:59:35 -05:00
Chris Willis-Ford 8e1719b716 Merge pull request #920 from towerofnix/scroll-detection
Scroll wheel detection for "when key (up/down) pressed" blocks
2018-02-16 12:21:27 -08:00
kchadha 9675a1b8cf Merge pull request #931 from kchadha/bugfix-912
Renaming sprite/costume/sound/backdrop updates corresponding blocks.
2018-02-12 11:53:50 -05:00
Karishma Chadha 4cca426f96 Adding test coverage for new updateAssetName function. 2018-02-09 17:29:41 -05:00
Paul Kaplan 8d42db7df8 Merge pull request #925 from LukeSchlangen/fix/rounding-numbers
round numbers but break tests
2018-02-08 08:59:54 -05:00
Luke Schlangen 45cf1f685d add passing unit test 2018-02-07 17:49:18 -06:00
Eric Rosenbaum c32086f56a Unit test for loudness with caching 2018-02-06 12:26:20 -05:00
Karishma Chadha 3dbcf13c87 Fixing renameSprite tests. 2018-02-05 17:26:13 -05:00
kchadha 107adad647 Revert "Push reported" 2018-02-02 12:42:09 -05:00
Luke Schlangen f8dced53dc round numbers but break tests 2018-01-31 08:23:08 -06:00
Florrie be83c0ee74 Mouse wheel IO system
Towards fixing #865. This adds an IO class for detecting the mouse wheel
being scrolled. Basic tests are included; they mock the runtime to see
what blocks are activated by scrolling.
2018-01-26 17:13:01 -04:00
Michael "Z" Goddard 4286e3e982 Add Thread.blockContainer
Store the thread's blocks at blockContainer letting execute quickly
determine the block source. Monitor threads are a monitor thread. They
do not become a target thread suddenly.
2018-01-24 17:00:35 -05:00
Michael "Z" Goddard 6b7582f1c7 Report block result to stackFrame.justReported
- Add stackFrame.justReported

Report the block result to a known key `justReported` instead of a
dynamic key on `reported`. Assuming blocks with a promised value are
relatively infrequent the most common recursive input flow immediately
reads the value "just" reported. In the assumed uncommon case of a
promised thread status, empty the already argValues assigned values
onto the currentStackFrame's reported member. In the next execute call
on this stackFrame, values assigned to reported are read back off onto
argValues, and execute will returned to the assumed common case. This
is a safe assumption since a thread in the promise state will not exit
that state until the next frame when javascript has a chance to call
the resolve handle, setting the thread's state back to another
executable state.

Using direct assignment to `justReported` saves building an object
dynamically. Instead of always building `reported` and `argValues` only
`argValues` is built until a promised state is reached. This also gives
a known time when `reported` is used, allowing cleanup of a
stackFrame's reported to only happen when it was used to persist
already reported values.
2018-01-24 17:00:12 -05:00
Paul Kaplan 327d1179d9 Update the mouse io to give scratch coordinates and client coordinates
Fixes GUI #642 https://github.com/LLK/scratch-gui/issues/642

Fixes GUI #179 https://github.com/LLK/scratch-gui/issues/179
2018-01-09 10:37:16 -05:00
Paul Kaplan bbcb6bd5b7 Differentiate clamped from non clamped mouse io data (GUI#179) 2018-01-09 09:42:16 -05:00
Paul Kaplan 3afe709cb0 Add unit tests for new reporter blocks in looks 2018-01-04 10:42:51 -05:00
Paul Kaplan 6d90a34ff1 Add setDragMode primitive and unit test 2017-12-29 09:38:21 -05:00
Paul Kaplan 477ef531ba Update specmap and sb2 import to add new fields to layering blocks. 2017-12-28 14:53:35 -05:00
Paul Kaplan d001a85571 Add setDragMode primitive and unit test 2017-12-28 12:31:23 -05:00
Karishma Chadha 29c08c3583 Fixing unit test. 2017-12-21 19:06:11 -05:00
Paul Kaplan a586c5d9cd Revert "Fix test"
This reverts commit 6b00f97804.
2017-12-13 15:37:44 -05:00
Paul Kaplan 8411ef1c86 Merge pull request #810 from paulkaplan/select-after-drag
Select target after drag end
2017-12-12 10:55:27 -05:00
Paul Kaplan 2d2b691b6f Return a default falsey value for unknown params based on param type 2017-12-06 11:46:43 -05:00
Paul Kaplan e6bd474720 Merge pull request #845 from kchadha/broadcast-msg-extra-create-bugfix
Broadcast Msg Bugfix
2017-12-05 15:38:12 -05:00
Paul Kaplan bb69d157cd Merge pull request #832 from paulkaplan/custom-procedure-updates
Updates for editable custom procedures
2017-12-05 15:37:56 -05:00