Commit graph

478 commits

Author SHA1 Message Date
Paul Kaplan
ea534b35ea Position the speech bubble more tightly. 2018-03-23 10:51:19 -04:00
Florrie
1db4a2c7a7 Compatibility implementation 2018-03-22 18:55:36 -03: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
Eric Rosenbaum
2b985fa083
Merge pull request #975 from ericrosenbaum/bugfix/move-volume-to-rendered-target
Move volume to rendered target
2018-03-19 16:45:25 -04:00
Chris Willis-Ford
4c0e968bec
Merge pull request #978 from cwillisf/fix-saythink-and-wait
Fix say/think and wait
2018-03-19 10:36:01 -07:00
Christopher Willis-Ford
b61c6a8f76 Don't render say/think bubbles during tests
This change makes say & think commands work during headless tests.
2018-03-14 16:07:05 -07:00
Eric Rosenbaum
a652156032 Sensing-of block gets target volume 2018-03-13 11:45:11 -04:00
Eric Rosenbaum
f8c2771776 Use target volume, not custom state 2018-03-13 11:43:53 -04:00
Jake Bartles
11e12cca4f fixed issue 960 2018-03-05 20:15:49 -05:00
Florrie
928df260ff Fix lint errors 2018-03-05 15:46:54 -04:00
Florrie
defcc45419 Implement foreach block 2018-03-05 15:36:26 -04: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
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
33966ba582 Check for runtime.currentStepTime is null 2018-02-06 12:25:44 -05:00
Eric Rosenbaum
0a239005a9 Rename and initialize vars 2018-02-06 11:06:48 -05:00
Eric Rosenbaum
c661ac7cce Only measure loudness once per step 2018-02-01 19:53:41 -05:00
Eric Rosenbaum
f78ddb2072 Change pitch effect range to -360 to 360 2018-01-31 16:44:54 -05:00
Luke Schlangen
f8dced53dc round numbers but break tests 2018-01-31 08:23:08 -06:00
Eric Rosenbaum
115184a2a3
Merge pull request #891 from ericrosenbaum/bugfix/audioplayer-clone-state
Audio effects state for clones
2018-01-23 11:55:39 -05:00
Eric Rosenbaum
275b0c7944 Get customState but don’t create it 2018-01-22 16:38:45 -05:00
Paul Kaplan
90e9e1c0b0
Merge pull request #889 from paulkaplan/fix-mouse-positions
Fix mouse positions for different stage zoom levels
2018-01-17 13:49:23 -05:00
DD
323aafd165 Update VM's model of monitored blocks 2018-01-10 17:57:04 -05:00
Eric Rosenbaum
eca66e9dde Check for runtime 2018-01-09 19:22:33 -05:00
Eric Rosenbaum
7c0117e9ed Clones get synced to parent’s sound state 2018-01-09 15:56:58 -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
d6f1c48c08 Add opcodes for new looks reporters with menu for costume number/name 2018-01-04 10:04:54 -05:00
Paul Kaplan
6d90a34ff1 Add setDragMode primitive and unit test 2017-12-29 09:38:21 -05:00
Paul Kaplan
fe51bd6450 Update layering blocks 2017-12-28 14:40:08 -05:00
Paul Kaplan
d001a85571 Add setDragMode primitive and unit test 2017-12-28 12:31:23 -05:00
Eric Rosenbaum
a6d17fcba3 Stop all sounds for all targets 2017-12-20 14:00:23 -05:00
Eric Rosenbaum
8e554245c8 Check for runtime 2017-12-20 10:56:44 -05:00
Eric Rosenbaum
9f6cd92d93 Clear sound effects for all targets on GF and stop 2017-12-20 10:38:16 -05:00
Eric Rosenbaum
a81b81251b Remove current instrument from sound state 2017-12-19 15:54:45 -05:00
Paul Kaplan
437cee3c14 Cast to string before asking question. Same as say blocks do. 2017-12-15 15:52:04 -05:00
Paul Kaplan
0fe7eca018 Fix procedure name lookup to work with undefined procedures. 2017-12-13 15:37:58 -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
Eric Rosenbaum
506a36b8ef
Merge pull request #838 from ericrosenbaum/feature/move-extensions-into-folder
Move pen and wedo into extensions folder
2017-12-05 15:43:03 -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
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
Paul Kaplan
aa306e1f29
Merge pull request #841 from sjhuang26/issue-795-clear-answer
Clear answer on green flag
2017-12-04 11:41:16 -05:00
sjhuang26
b2802b75f1 Go to front in stage does nothing 2017-12-02 08:33:32 -05:00
sjhuang26
eede8105d1 Clear answer on green flag 2017-12-01 20:06:55 -05:00
Paul Kaplan
0722708004
Merge pull request #817 from sjhuang26/develop
Fix ask-and-wait in stage
2017-12-01 11:53:37 -05:00
Paul Kaplan
a9e95f3b01
Merge pull request #829 from kchadha/broadcast-message-typed-variable
Broadcast message functionality
2017-12-01 11:51:38 -05:00
Eric Rosenbaum
9611401e1c Move pen and wedo into extensions folder 2017-12-01 10:31:04 -05:00
Paul Kaplan
5a53323715 Update to use explicit procedure names and ids 2017-11-29 12:00:00 -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
sjhuang26
f610816e72
Added wasStage parameter 2017-11-24 21:28:48 -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
DD Liu
58dd57fe48
Merge pull request #784 from fsih/perSpriteMonitors
Execute monitors on a given target ID when block is sprite-specific
2017-11-21 10:23:53 -05:00
Eric Rosenbaum
614708d48c
Merge pull request #785 from ericrosenbaum/feature/load-drums-from-storage
Load drum sounds from storage and play them
2017-11-20 13:56:23 -05:00
DD
255e160ebb Change it so we dont have to do string manipulation on IDs to get data out of events 2017-11-16 17:19:51 -05:00
Paul Kaplan
bbb8904467
Merge pull request #789 from paulkaplan/custom-procedure-update
Update naming and implementation for custom procedure blocks
2017-11-16 17:07:03 -05:00
Paul Kaplan
34dfbb50ba Update naming and implementation for custom procedure blocks 2017-11-16 14:17:08 -05:00
DD
0958db2618 Move data to blocks files 2017-11-15 17:53:43 -05:00
Eric Rosenbaum
5b0f7453f3
Merge pull request #779 from ericrosenbaum/feature/music-timing-with-stackframe
Music extension handles timing
2017-11-15 13:29:33 -05:00
Paul Kaplan
1e27d21b15
Merge pull request #782 from kchadha/list-typed-variable
List typed variable
2017-11-15 12:48:56 -05:00
Eric Rosenbaum
961b3476b2 Move the music extension into a new extensions directory 2017-11-13 16:22:37 -05:00
Eric Rosenbaum
be25cd93bd Use stack timer for timing of drum, note and rest blocks. 2017-11-13 10:43:09 -05:00
Eric Rosenbaum
db3b0ca204 Move musical timing into music extension
and use the stackframe timer, which improves timing accuracy.
2017-11-09 17:49:42 -05:00
Karishma Chadha
70959cc7f5 First cut at turning lists into typed variables 2017-11-09 17:19:34 -05:00
Paul Kaplan
16ca994818 Allow ask to use say bubble via events 2017-11-08 11:12:12 -05:00
Eric Rosenbaum
50c646259c Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/extension-music 2017-11-07 15:54:38 -05:00
Eric Rosenbaum
112bb55b9b JSDoc 2017-11-07 15:21:47 -05:00
Eric Rosenbaum
9bd48e8761 Mark the buildMenu function private 2017-11-07 15:21:20 -05:00
Ray Schamp
180e545b4e
Merge pull request #766 from mzgoddard/execute-handle-report-block-utility
Extract handleReport and BlockUtility from inside the execute function
2017-11-07 12:19:23 -05:00
Eric Rosenbaum
87cf546b03 Remove music opcodes from sound bocks 2017-11-07 11:28:04 -05:00
Paul Kaplan
1f98960636
Merge pull request #764 from paulkaplan/ask-answer-events
Ask/answer opcode implementation with runtime events.
2017-11-07 10:49:48 -05:00
Michael "Z" Goddard
e3dfe24d7f
Store references to target in say blocks
As part of reusing the block utility object, asynchronous say block
functions cannot use the utility in a promise or timeout asynchronous
handle. Store the needed target reference so utility is not needed
later.
2017-11-07 10:21:52 -05:00
Eric Rosenbaum
fbeb1de1c1 Add music extension file 2017-11-06 16:57:16 -05:00
Paul Kaplan
73ffc6a797 Ask/answer opcode implementation with runtime events. 2017-11-06 15:08:15 -05:00
Eric Rosenbaum
a735459427
Merge pull request #762 from ericrosenbaum/bugfix/wedo-tilt-reporter-shape
Fix shape of boolean tilt reporter
2017-11-06 11:21:12 -05:00
Eric Rosenbaum
59e0c75abf Fix shape of boolean tilt reporter 2017-11-06 10:17:53 -05:00
Eric Rosenbaum
323fde3859 Appease the linter 2017-11-06 10:10:41 -05:00
Eric Rosenbaum
cc35bcc791 Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/wedo-block-icon 2017-11-06 10:02:57 -05:00
Eric Rosenbaum
0540640684
Merge pull request #754 from ericrosenbaum/feature/pen-block-icon
Extension block icons (including pen icon)
2017-11-06 10:02:23 -05:00
Eric Rosenbaum
14087ef24f Add wedo block icon 2017-11-06 10:00:13 -05:00
Paul Kaplan
caa9b97520 Fix linting 2017-11-04 10:10:17 -04:00
Paul Kaplan
8616390fab Add back pen transparency from color number 2017-11-03 21:24:47 -04:00
Eric Rosenbaum
a115d47bb8 Add block icon svg as single-line data URI 2017-11-03 11:25:39 -04:00
Paul Kaplan
c5d3e2dbb4
Merge pull request #746 from paulkaplan/fix-variable-of
Search for variables by name in "of" block
2017-11-02 11:09:42 -04:00
Paul Kaplan
2c3c9f9ac8 Search for variables by name in "of" block 2017-11-01 14:31:52 -04:00
Paul Kaplan
18398d010b Add hideFromPalette flag for hiding legacy blocks 2017-11-01 11:30:15 -04:00
Paul Kaplan
082e051cce Support legacy pen block op codes 2017-11-01 11:30:15 -04:00
Paul Kaplan
48d3b20d69 Stringify things before saying 2017-10-30 15:38:56 -04:00
Paul Kaplan
bbbd3dd64b Make test pass for undefined proc execution 2017-10-25 10:29:07 -04:00
Paul Kaplan
f07c70938a Merge pull request #729 from paulkaplan/fix-say-think-moving
Fix several say/think bugs
2017-10-24 08:40:29 -04:00
Paul Kaplan
c14155c26d Fix comment on drawableVisible property 2017-10-24 08:17:31 -04:00
Paul Kaplan
09bb01893c Add back the visibility optimization in a simpler way. 2017-10-23 14:24:54 -04:00
Paul Kaplan
24d550d860 Remove "visible" state flag and use target visibility directly.
This fixes several other bugs like "saying" from a hidden sprite.
2017-10-23 13:26:08 -04:00
Eric Rosenbaum
9ffbd60bad Merge pull request #725 from ericrosenbaum/feature/pen-extension
Set/change pen color blocks with color, brightness, saturation, transparency
2017-10-23 11:25:09 -04:00
Paul Kaplan
5ca58c7ceb Fix new bubbles not moving with their owning sprite.
This was the original issue #728 that spurred these changes.
2017-10-23 11:20:46 -04:00
Paul Kaplan
87a0224790 Stop hide timeouts from sticking around through green flag/stop. 2017-10-23 11:19:39 -04:00
Paul Kaplan
44ca62fefc Fix event listeners not being cleaned up
Eventually if you hit the green flag a million times with a "green flag
=> say" stack, you'd get an event emitter memory leak error.
2017-10-23 11:17:39 -04:00
Eric Rosenbaum
0a18ce7287 Lint 2017-10-18 13:16:24 -04:00
Eric Rosenbaum
bddabdbac6 JSDocs 2017-10-18 11:48:45 -04:00
Eric Rosenbaum
b5ad5e1f6b Warn on set or change unknown color parameter 2017-10-18 11:33:52 -04:00
Eric Rosenbaum
aab1b834d6 On set color using picker, reset transparency to 0 2017-10-17 23:13:05 -04:00
Eric Rosenbaum
a32f7a6402 Default color setting matches default RGB values
For color (hue) in range 0-100, to get RGB (0, 0, 1), we need to use 100 * 2/3 = 66.66
2017-10-17 23:10:58 -04:00
Eric Rosenbaum
240c48ad0c Set or change color param with a single function 2017-10-17 19:31:51 -04:00
Eric Rosenbaum
086df4652e Remove references to pen shade 2017-10-17 12:23:38 -04:00
Eric Rosenbaum
264042b4cc Use the word “color” instead of “hue” 2017-10-17 12:22:53 -04:00
Eric Rosenbaum
4f8782cc84 Remove unused function 2017-10-17 11:27:46 -04:00
Eric Rosenbaum
3d6644609f Add new set/change color param blocks with menu
And remove set/change color and shade blocks. All 4 params are now scaled 0-100.
2017-10-17 11:25:22 -04:00
Eric Rosenbaum
22e70ce095 Remove unused arguments for “clear” block 2017-10-17 11:25:22 -04:00
Chris Willis-Ford
c4e79c9732 Merge pull request #713 from cwillisf/fix-extension-hats
Fix extension hats
2017-10-13 16:03:51 -07:00
Chris Willis-Ford
7051ccfd69 Merge pull request #687 from cwillisf/builtin-extensions
Builtin extensions
2017-10-13 09:48:56 -07:00
Christopher Willis-Ford
1a9e28bfc9 Small WeDo 2.0 fixups 2017-10-13 01:48:25 -07:00
Paul Kaplan
4599a71dd7 Try to pin the bubbles within the left/right bounds 2017-10-11 16:34:50 -04:00
Paul Kaplan
b00a619e2d Only flip bubble if it would fit the other way 2017-10-11 16:27:51 -04:00
Paul Kaplan
9af9eb1d92 Fix hide/show 2017-10-10 15:35:48 -04:00
Christopher Willis-Ford
ef3feca385 Fix typo in WeDo 2.0 blocks metadata 2017-10-06 10:56:38 -07:00
Paul Kaplan
14600d7893 Update looks implementation 2017-10-06 13:43:07 -04:00
Christopher Willis-Ford
7297341c51 Fixups from code review
- Remove WeDo 2 extension from the runtime's default block packages list
- The WeDo 2.0 extension now calls its own `connect` method on startup

I also renamed `EXTENSION_NAME` to `EXTENSION_ID` for consistency with
the rest of the extension system.
2017-10-06 09:55:19 -07:00
Paul Kaplan
43d061227c WIP 2017-10-05 17:03:30 -04:00
Paul Kaplan
43a17bdaa8 Add say/think functionality to looks blocks 2017-10-05 11:16:27 -04:00
Christopher Willis-Ford
e9aed49a05 Make loadExtensionURL handle built-in extensions
WeDo2 and Pen blocks have been converted to internal extensions, and can
now be loaded by giving `loadExtensionURL` the string 'pen' or 'wedo2'
instead of an actual URL.
2017-10-04 13:00:39 -07:00
Christopher Willis-Ford
6757fb6de9 Convert pen blocks into an "internal" extension 2017-10-04 12:54:30 -07:00
Eric Rosenbaum
58eaeaaf6a Add pen transparency, clamped 0-100 2017-09-05 18:00:34 -04:00
Eric Rosenbaum
2b89063827 Merge branch 'patch-1' of https://github.com/Kenny2github/scratch-vm into Kenny2github-patch-1 2017-09-05 11:38:27 -04:00
Ken
3185eb27e1 Rewrote transparency block
Wrapping of the value is now handled by a new function, _wrapTransparency;
_updatePenColor now handles the transparency value;
DEFAULT_PEN_STATE now includes a transparency value (100).
2017-09-01 14:11:09 +08:00
Ken
f61366643d Clamp transparency value (at least for set) 2017-08-31 09:24:41 +08:00
Ken
fc4f073526 Add glide (number) secs to [dropdown] block (#662)
* Add glide to dropdown block

* Use helper functions instead of copy-paste

* Wrong syntax for array 😒

* Aha

* Fix some Travis issues

* Aha!! This should work

* Wow, Travis is strict about spacing!

* Make requested changes

Rename function getTarget to getTargetXY
Rename parameter TO to targetName
2017-08-28 15:44:34 -04:00
Ray Schamp
f367f2d358 Merge pull request #670 from rschamp/eslint-config-scratch-4
Update eslint and eslint-config-scratch
2017-08-26 13:26:05 -04:00
Ray Schamp
32bc087bba Fix remaining lint issues 2017-08-26 13:24:10 -04:00
Ray Schamp
5113876588 Pass with --fix 2017-08-26 13:24:10 -04:00
Ken
8a77329c79 Fix lint issue and update maximums
Inferring from the issue, the maximum seems to be 100, not 255 (default for set is 50 and change is 10). Changed that.
A comment line was too long (thanks lint) so it has now been reworded.
2017-08-25 15:24:56 +08:00
Ken
e30e5809d1 Add new blocks
change pen transparency by (num)
set pen transparency to (num)
2017-08-25 15:07:38 +08:00
SillyInventor
525b601253 Switch from parseInt to Math.floor 2017-08-22 10:30:41 -04:00
Ken
884e24f782 *facepalm* 2017-08-11 02:23:43 +12:00
Ken
28e61dbf48 Cleaned up 2017-08-11 01:58:59 +12:00
Ken
328514ae63 This kinda doesn’t make sense, but ok 2017-08-11 01:46:26 +12:00
Ken
5af99566fa Wait includes is case sensitive
Made it convert to lowercase before comparing
2017-08-11 01:27:31 +12:00
Ken
3b601e8595 Add string contains string 2017-08-11 00:52:41 +12:00
Paul Kaplan
44298fd71b Use soundId instead of md5 for playing sounds 2017-07-25 12:20:32 -04:00
Paul Kaplan
2ddb6215fd Add tests and fixes for set instrument and play drum 2017-07-06 14:56:46 -04:00
Paul Kaplan
1b6baf8114 Make playSound use one indexing 2017-07-06 14:28:11 -04:00
Chris Willis-Ford
47fc38fd9a Merge pull request #619 from cwillisf/clone-custom-state
Clone custom state
2017-06-27 22:37:30 -07:00
Eric Rosenbaum
01f801a2a2 Remove all audio effects except pitch and pan 2017-06-19 14:56:29 -04:00
Christopher Willis-Ford
06d5994a32 Use targetWasCreated event to clone pen state
Remove explicit cloning of `_customState` in favor of smarter,
state-specific cloning.
2017-06-16 14:22:51 -07:00
DD Liu
fb986effe6 Merge pull request #593 from fsih/fixWaitCalledEveryFrame
Change wait to use a promise instead of being called every frame
2017-06-08 15:35:48 -04:00
Chris Willis-Ford
d41997b58b Merge pull request #556 from cwillisf/wedo2-blocks
Add WeDo 2.0 blocks
2017-06-07 09:57:36 -07:00
DD Liu
e237d24846 fix lint 2017-06-06 10:21:27 -04:00
DD Liu
ab0cef52eb Change wait to use a promise instead of being called every frame 2017-06-05 16:55:15 -04:00
Christopher Willis-Ford
cbfbc5d600 Convert motor duration: seconds -> milliseconds
The block takes seconds, whereas the device takes milliseconds. Turning
on a motor for 1 millisecond isn't very dramatic.
2017-05-24 16:40:55 -07:00
Christopher Willis-Ford
06fe701624 Implement WeDo 2.0 blocks 2017-05-24 16:40:55 -07:00
Christopher Willis-Ford
2625529ebe Create WeDo 2.0 device communication classes 2017-05-24 16:40:55 -07:00
Ray Schamp
548aa6dd70 Fix no-useless-call todo
The linter is correct that `devObject[func].call(devObject, args)` is unnecessary because it's equivalent to `devObject[func](args)`.

@tmickel probably either meant to allow passing an array of arguments to be applied, or to call the function with the provided argument. Since we probably want to be able to use multi-argument functions, use `apply` and fix the one place that uses `ioQuery` with an argument.
2017-05-15 21:11:38 -07: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
Rasmus Haglund
b693d4f4ef Fix rounded get size reporting 2017-04-08 19:35:29 +02:00
Eric Rosenbaum
092084cc6b Merge pull request #513 from ericrosenbaum/feature/loudness
Add loudness block
2017-04-07 14:06:18 -04:00
Eric Rosenbaum
b74c03dbbd Loudness returns -1 if no audio engine exists
To match Scratch 2.0 behavior
2017-03-27 13:20:44 -04:00
Silly Inventor
77775cdadb Switch to using number directly, instead of toNumber for costume switch (#499) 2017-03-23 18:34:04 -04:00
Eric Rosenbaum
b4a94c266f Add loudness block 2017-03-20 17:01:44 -04:00
Eric Rosenbaum
106db6a024 Clamp range for each audio effect 2017-03-20 14:53:04 -04:00
Eric Rosenbaum
c9338f37ed Clamp tempo range
The function in AudioEngine for change tempo can now be removed
2017-03-17 18:13:33 -04:00
Eric Rosenbaum
f2ac365859 Clamp beat durations for play note, play drum and rest 2017-03-17 17:29:23 -04:00
Eric Rosenbaum
1ba7ad0218 Clamp range for “play note” input
Clamp to 36-96, which is C2-C7.

This is a temporary fix to prevent errors, until we have a new instrument player implementation, which may have a different range.
2017-03-17 17:23:53 -04:00
Chris Willis-Ford
a56db95aba Merge pull request #446 from magmaboat/hasownproperty
Perform hasOwnProperty validation
2017-02-22 13:55:54 -08:00
Eric Rosenbaum
99be466aa7 Merge pull request #444 from ericrosenbaum/bugfix/playnote-volume
Pass volume to audioengine playnote
2017-02-10 14:09:55 -05:00
Magmaboat
85eee4f18e Perform hasOwnProperty validation 2017-02-09 21:12:47 -05:00
Eric Rosenbaum
cd750b5dda pass volume to audioengine playnote 2017-02-09 14:52:15 -05:00
Chris Willis-Ford
cde9ebd6bf Merge pull request #442 from griffpatch/bug/PenColorOpacity
Bug pen opacity reset
2017-02-09 07:53:15 -08:00
griffpatch
2ba177aa0f Bug - Return pen opacity to opaque
When setting the pen color using pen blocks, the opacity should be reset
to fully opaque if no alpha is supplied.
2017-02-09 08:50:37 +00:00
griffpatch
9cb595312e Implement "Stop this script" function
Existing implementation incorrectly terminates the entire thread.
See: http://llk.github.io/scratch-vm/#144142535
2017-02-08 09:44:10 +00:00
Andrew Sliwinski
92ff57de7d Add basic test coverage for the sound blocks 2017-02-03 17:39:36 -05:00
Eric Rosenbaum
9741dc2e35 Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound 2017-02-02 16:37:07 -05:00
Ray Schamp
727fcc7875 Lint for eslint-config-scratch@3 2017-02-01 16:27:55 -05:00
Eric Rosenbaum
0947775a31 Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound 2017-02-01 10:18:01 -05:00
SillyInventor
1ac89f5aa4 Added new util function that sends tan function infinities correctly
Changed mathop to call new math util
Changed sin & cos to round correctly (to get 0)
Added testing for the new math util function
Added testing for the new mathop functions
2017-01-31 19:05:54 -05:00
Eric Rosenbaum
53127f6320 use customstate for sound volume, instrument, effects 2017-01-31 18:33:32 -05:00
Eric Rosenbaum
2d8491123e Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound 2017-01-30 11:28:52 -05:00
Eric Rosenbaum
dd30e07052 comments on getSoundIndex 2017-01-30 10:56:50 -05:00
Eric Rosenbaum
9d8819ddc7 audio engine handles rest block 2017-01-30 10:56:31 -05:00
Eric Rosenbaum
cb4209b27a target handles playnote via audio engine 2017-01-30 10:56:06 -05:00
Eric Rosenbaum
5966a46bbd target manages instrument setting 2017-01-30 10:54:24 -05:00
Eric Rosenbaum
4e4b0b86e1 target manages audio effect values 2017-01-30 10:53:12 -05:00
Eric Rosenbaum
4e57ab561d move playsound function to target 2017-01-30 10:45:15 -05:00
griffpatch
0dcaa46107 Fix lint issues
Had to update the test scripts to handle the alpha channel, also I note
that all the hex tests are using CSS notation, not scratch notation
(which is 0x not #)
2017-01-27 17:05:17 +00:00
griffpatch
b856041d9a Fix for Support ARGB for pen #393
Requires fix to scratch-render before this will work (see:
6f5acfee7b961d71237f1fd50bb3d5a5139c527e)
2017-01-27 13:45:16 +00:00
Christopher Willis-Ford
88cc50aa18 Code review: more docs, move constants, clone util
Changes include:
- Added missing JSDoc for items in `scratch3_pen.js` and `target.js`.
- Moved constants used by `Scratch3PenBlocks` into the class.
- Created a constant for minimum and maximum pen size.
- Added `util/clone.js` to host cloning functionality.
- Pen blocks now check for the renderer before trying to use it.
- The pen integration test covers all blocks, though `clear`, `stamp`,
  and `pen down` will skip some of their functionality when there is no
  renderer.
2017-01-20 11:26:18 -08:00
Christopher Willis-Ford
a6190da774 Lint fixes and related cleanup 2017-01-19 12:50:46 -08:00
Christopher Willis-Ford
369c02b5d5 Implement pen blocks
These blocks implement pen features as found in Scratch 2.0

Supporting changes include:
- `Target` is now an event emitter
- `RenderedTarget` now emits an event when it moves
- `Target` can now store arbitrary "extra" data, called "custom state"
  in the code, using a `Target`'s `setCustomState` and `getCustomState`
  methods. This is used to store per-target pen state without requiring
  `Target` or `RenderedTarget` to know anything about the pen.
- `Cast` can now cast to an RGB color object.
- `Color` now has functions to convert between RGB and HSV, constants
  for for black & white, and a `mixRgb` function to lerp between two
  colors.
2017-01-19 11:51:22 -08:00
Eric Rosenbaum
9cc1c316d6 wrapclamp drum and instrument to num available 2017-01-11 11:41:21 -05:00
Eric Rosenbaum
f2ad364b90 vm converts one-indexing of drums and instruments to zero-indexing 2017-01-11 11:23:39 -05:00
Eric Rosenbaum
71339874de fix name of DRUM arg 2017-01-11 11:22:58 -05:00
Eric Rosenbaum
76a475c31c cast args to numbers 2017-01-10 18:00:33 -05:00
Eric Rosenbaum
4d7ff97011 instrument number is zero-indexed inside audio engine 2017-01-09 15:48:31 -05:00
Eric Rosenbaum
ce8b069140 include volume reporter 2017-01-09 15:48:02 -05:00
Eric Rosenbaum
2d7cfd128a use a single global tempo owned by audioengine 2017-01-09 15:47:29 -05:00
Eric Rosenbaum
fec9e5b91a add audio to playground 2017-01-06 11:49:25 -05:00
Eric Rosenbaum
9350baef3b add current volume block 2017-01-06 10:31:11 -05:00
Eric Rosenbaum
dbe2cef93c move promise into audio engine
changes to play note, play drum and rest blocks so their promises to wait are returned by the audio engine
2017-01-06 10:31:01 -05:00
Eric Rosenbaum
c0d57b4b6b separate out main audioengine from audioplayer for each clone 2017-01-04 18:37:55 -05:00
Eric Rosenbaum
5a1386f727 remove redundant type check 2017-01-04 14:42:00 -05:00
Eric Rosenbaum
3bf9238e0c treat numeric input to sound name as 1-indexed 2017-01-04 14:41:14 -05:00