Commit graph

480 commits

Author SHA1 Message Date
picklesrus
4a542b455d fix code review comments 2018-11-28 10:36:22 -05:00
picklesrus
f214d3a191 VM changes for the sensing_of block. This handles lists properly (by ignoring them like Scratch2 and makes the attribute menu update based on what was chosen in the target menu. 2018-11-28 10:35:35 -05:00
Katie Broida
bb82c46f8a
Handle coordinate precision the same as Scratch 2 (#1722) 2018-11-15 15:50:56 -05:00
jokebookservice1
306996e54c
feat: Implement "point towards random direction"
We subtract 180 even though the value will be clamped, for clarity. We round so that
using the "direction" getter will yield a sensible result. Note that this
implements 'point towards random direction', not 'point towards random
position' -- they have slightly different behaviours.
2018-11-11 01:51:37 +00:00
Karishma Chadha
5db3db3a92 monitor id getter should use block fields instead of a list of strings 2018-11-08 01:33:26 -05:00
Karishma Chadha
0e7eae98d5 Separate out monitors for blocks reporter blocks that have parameters. 2018-11-08 00:37:28 -05:00
Eric Rosenbaum
3bd0797810
Make volume a sprite-specific monitor (#1730) 2018-11-06 10:52:40 -05:00
Karishma Chadha
fd5e178d3b
Merge pull request #1703 from kchadha/cloud-io
Cloud IO
2018-10-30 11:57:20 -04:00
Karishma Chadha
be238d35d2
Merge pull request #1517 from joker314/costume-compatibility
Make "switch costume" and "switch backdrop" blocks compatible with 2.0
2018-10-29 11:39:41 -04:00
Karishma Chadha
aa200e6df3 Set the cloud provider and request updates to the cloud var when updating the variable through blocks. 2018-10-29 00:59:06 -04:00
Michael "Z" Goddard
fcafcbdd0a
return 0 from parameters outside of their procedure 2018-10-23 15:14:31 -04:00
Michael "Z" Goddard
ef4045aaf1
Merge pull request #1642 from mzgoddard/set-procedure-param-defaults
Set procedure param defaults
2018-10-23 15:13:16 -04:00
Michael "Z" Goddard
5e5655c916
Merge pull request #1632 from mzgoddard/stop-other-sounds
Stop other sounds
2018-10-23 15:11:08 -04:00
jokebookservice1
9c128db723
docs: Provide more/clearer comments
We ensure that all code whose purpose may be confusing to grasp is
commented; and we remove information that is no longer required.
2018-10-17 18:32:01 +01:00
Michael "Z" Goddard
2b257dde57
add getProcedureParamNamesIdsAndDefaults
Use getProcedureParamNamesIdsAndDefaults to get the defaults along with
names and ids so defaults may be set for a procedure call if the
parameter is not provided.
2018-10-16 16:31:45 -04:00
Michael "Z" Goddard
e854d8d563
stop only waiting sounds when STOP_FOR_TARGET is emitted 2018-10-16 16:15:01 -04:00
Andrew Sliwinski
23f6346045
Merge pull request #1631 from mzgoddard/stop-other-asks
Stop other asks
2018-10-15 13:16:49 -04:00
jokebookservice1
341bd8f3d3
feat: Allow switching to specially named backdrops
The `switch costume` block accepts special values like "next costume" and
"previous costume". If you create a costume with these names, these take
priority over the special values. However, the `switch backdrop` block
keeps these special values for values like "next backdrop", "previous
backdrop", "random backdrop". It is impossible to navigate to such a
backdrop by name via block. This commit also modifies tests to allow for
this.

BREAKING CHANGE: specially-named backdrops can now be navigated
2018-10-10 20:06:54 +01:00
jokebookservice1
0c18b4952d
refactor: use better whitespace-test for backdrops too 2018-10-10 19:45:36 +01:00
jokebookservice1
df78a8345e
refactor: use utility for whitespace-testing 2018-10-10 18:36:06 +01:00
Michael "Z" Goddard
65ee6b7cac
broadcast and wait must wait for threads to be removed from runtime 2018-10-05 14:54:02 -04:00
Michael "Z" Goddard
da268ea0c1
control sound stopping in scratch3_sound.js
- Stop sound playback for target when STOP_FOR_TARGET is emitted
- Stop all sounds when PROJECT_STOP_ALL is emitted
- RenderedTarget should not manage sound stopping in `stopAll`
2018-10-03 10:38:47 -04:00
Michael "Z" Goddard
574749bbba
add STOP_FOR_TARGET runtime event and respond for ask blocks
Remove questions for targets that are individually stopping and
progress the asked question if it is from a stopping target.
2018-10-03 10:38:14 -04:00
apple502j
7b6ba8cb9a
Bubble string length limit 2018-09-14 20:56:40 +09:00
jokebookservice1
3ef61e2248
Make SWITCH COSTUME and SWITCH BACKDROP compatible with 2.0 2018-08-22 20:39:15 +03:00
Karishma Chadha
d1761466fc
Merge pull request #1427 from paulkaplan/fix-bubble-positioning
Remove heuristic for bubble positioning that was not accurate.
2018-08-22 10:39:50 -04:00
Florrie
5af79a086b Use round() instead of floor() in repeat, add unit test 2018-08-14 20:27:18 -03:00
Paul Kaplan
ae3605b00c Remove heuristic for bubble positioning that was not accurate.
"guessing" the bubble positioning before rendering is no longer needed because the positioning logic has changed, bubbles that don't fit during the positioning stage get flipped.
2018-08-06 16:00:20 -04:00
Paul Kaplan
6d4c6df692 Add UserData ioDevice for setting and getting username from blocks 2018-07-23 09:38:58 -04:00
Andrew Sliwinski
f7aafe4d9c Add opcode implementation for data_deletealloflist 2018-07-11 13:14:01 -04:00
Paul Kaplan
2c7de6380e Add implementation for "When loudness >" block 2018-07-05 09:42:00 -04:00
Paul Kaplan
63e96634bf Use bounds of the renderer instead of stage target for positioning.
Fixes the regression where bubbles almost always point left instead of right.
2018-06-28 16:45:07 -04:00
Paul Kaplan
a6a29a5437 Fix hidden bubbles not resetting on stop 2018-06-28 16:44:33 -04:00
Ray Schamp
9afe401dca Revert "Revert #1260, #1258, #1239"
This reverts commit 28f90648b0.
2018-06-22 09:33:08 -04:00
Ray Schamp
28f90648b0 Revert #1260, #1258, #1239
This reverts commits
c268bbae47
61dacfc915
30b8cb8eb1
2018-06-22 09:30:17 -04:00
Corey Frang
c087cf326a soundbank tests 2018-06-21 17:00:03 -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
Paul Kaplan
418c3837c6
Merge pull request #1209 from technoboy10/bugfix/gh-1135-bubble-edge
Check that bubble bounds do not extend past stage boundaries
2018-06-11 12:14:53 -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
Michael "Z" Goddard
84705fc463
replace new Promise(r => r()) with Promise.resolve
Promise.resolve is a Promise convenience method that creates a promise
resolved to a given argument like creating a promise with a function
that immediately calls the resolve function with the given value.
2018-06-06 09:53:45 -04:00
Connor Hudson
25290e7f6a Check that bubble bounds do not extend past stage boundaries
For when you can't flip the bubble, but need it to remain on-stage
2018-06-05 15:58:03 -04:00
Eric Rosenbaum
2348d55f14 Use promises to yield 2018-05-31 17:09:47 -04:00
Eric Rosenbaum
46f885fc03 Sound effect and volume blocks request redraw 2018-05-31 16:47:40 -04:00
kchadha
a85f641d25
Merge pull request #1148 from kchadha/stage-layering
Layer group ordering.
2018-05-25 09:10:05 -04:00
Paul Kaplan
02041c8218
Merge pull request #1163 from paulkaplan/username-stub
Add logged out version of username block
2018-05-24 13:29:47 -04:00
Paul Kaplan
c5cc129821 Add logged out version of username block 2018-05-23 11:30:12 -04:00
Eric Rosenbaum
508ac91b82 Runtime emits key pressed event 2018-05-22 17:24:22 -04:00
Karishma Chadha
38875bc65c Bubbles should be in the same layer as sprites. Other cleanup. 2018-05-20 19:49:42 -04:00
Karishma Chadha
67b114b9c9 Layer group ordering. 2018-05-15 22:22:44 -04:00
Paul Kaplan
c18d5faafb Make sure to set the bubble to blank when hiding 2018-05-15 14:38:42 -04:00
Paul Kaplan
b7f3a06fa0
Merge pull request #1133 from paulkaplan/show-hide-vars
Add implementations for hiding and showing variables and lists.
2018-05-10 15:34:21 -04:00
Paul Kaplan
47e2264eba Add opcodes for hiding and showing variables and lists.
Note: to get them back into the toolbox, we need to change that in blocks.
2018-05-09 14:25:15 -04:00
Paul Kaplan
f3404f4275
Merge pull request #1128 from paulkaplan/sb2-monitors
Import monitors from sb2 files.
2018-05-09 13:52:29 -04:00
Paul Kaplan
6c9ecd9065 Return a new copy of the list for monitors when changes occur 2018-05-09 13:42:53 -04:00
Paul Kaplan
7d0121bc44 Return lists as arrays if running for monitors.
This is a strange quirk of the way the list blocks work, they get joined into a string for interoperability within other other scratch blocks. But for monitors, we need it to stay an array.
2018-05-09 12:24:01 -04:00
Paul Kaplan
9e372916a8 Add comment about sensing block id oddness 2018-05-09 10:52:00 -04:00
Kenny2github
8e9f9e0a30 Add one to index if random costume is current costume 2018-05-09 08:13:04 +08:00
Paul Kaplan
4713f47fb7 Import monitors from sb2 files.
Paired with @kchadha on all of this.
2018-05-08 17:06:19 -04:00
Kenny2github
3f1c4aa2d8 thought I was being smart by using inline assignment, but noooooo 2018-05-08 08:27:51 +08:00
Kenny2github
e3b7f53319 Make sure switched costume is not current costume 2018-05-08 08:21:27 +08:00
Kenny2github
4419014421 Handle random backdrop 2018-05-05 18:25:18 +08:00
Karishma Chadha
9cc34d7406 Fix attribute of block so that it doesn't have errors if referenced target doesn't exist. 2018-05-04 11:00:45 -04:00
Eric Rosenbaum
4cee734cde
Merge pull request #1008 from towerofnix/itemnum-vm
Implement "item # of (thing) in (list)" block
2018-05-03 18:08:31 -04:00
kchadha
54ee628b27
Merge pull request #1099 from towerofnix/scrollcompat-vm
"Implement" scroll blocks
2018-05-01 15:52:42 -04:00
kchadha
2b6f96ae0a
Merge pull request #1096 from towerofnix/warpspeed-vm
Implement "all at once" block
2018-05-01 15:43:37 -04:00
kchadha
3161831890
Merge pull request #1102 from towerofnix/misc-noop-vm
"Implement" miscellaneous no-op obsolete blocks
2018-05-01 15:42:53 -04:00
Florrie
25bb4bc82c Remove doNothing method 2018-05-01 14:00:34 -03:00
Florrie
97a9b37843 Remove doNothing methods 2018-05-01 13:58:09 -03:00
Florrie
8d13bf3662 Add comment explaining all-at-once 2018-05-01 13:43:32 -03:00
kchadha
ae8c1e0ebf
Merge pull request #1101 from towerofnix/loud-vm
Implement "loud?" block
2018-05-01 10:19:26 -04:00
Florrie
8c2d023925 Implement set/change stretch blocks 2018-04-30 21:29:34 -03:00
Florrie
fe13f30037 Lint 2018-04-30 21:04:50 -03:00
Florrie
231402fc53 Implement 'hide all sprites' and 'user id' blocks 2018-04-30 21:03:35 -03:00
Florrie
8e271c70d0 Implementation + tests for loud? block 2018-04-30 19:50:13 -03:00
Florrie
62b8dd93af Spec maps for scroll blocks + "implementations" 2018-04-30 17:45:35 -03:00
Paul Kaplan
8a9818d0d4
Merge pull request #1098 from paulkaplan/fix-say-bounds
Use renderer bounds instead of stage bounds for positioning bubbles.
2018-04-30 15:14:08 -04:00
Paul Kaplan
6c59ccbe1b Use renderer bounds instead of stage bounds for positioning bubbles.
Instead of using the rendered bounds of the stage (which can be larger than the actual rendering area of the stage due to large costumes), use the `nativeSize` which is the size in scratch coords of the rendering area. Note that `nativeSize` is not the size of the canvas element or anything like that, it is the "logical size", i.e. the [width, height] in scratch coords.
2018-04-30 14:26:25 -04:00
Paul Kaplan
3f97ccc8ce Remove the "optimization" for 2018-04-30 13:40:36 -04:00
Paul Kaplan
e4c109c0c8 Merge branch 'develop' into fix-say-flickering 2018-04-30 13:25:35 -04:00
Florrie
b6cb198144 Implement all-at-once block 2018-04-30 12:18:38 -03:00
Paul Kaplan
ad4f5652e4
Merge pull request #1088 from paulkaplan/fix-say-timing
Track say/thinks per target so they can maintain correct timing.
2018-04-27 11:10:12 -04:00
Paul Kaplan
c2bb1e3123 Add comment to jsdoc typedef where it belongs. 2018-04-27 09:21:38 -04:00
Paul Kaplan
3019d05181 Fix issue where say bubble flickers during conversation.
The fix for this involves something of hack where we decide whether to use the optimization that prevents "typewriter" style projects (say for 0.05s in a loop) based on the amount of time the block is going to run for. A full fix of this can only be achieved if the text bubble renders synchronously.
2018-04-26 13:03:57 -04:00
Paul Kaplan
50708c15e4 Track say/thinks per target so they can maintain correct timing. 2018-04-26 11:29:24 -04:00
Andrew Sliwinski
218725d771 Cast 'create clone' argument to string. Resolves GH-974 2018-04-26 10:29:29 -04:00
Paul Kaplan
393b5d54df Handle positioning bubbles for empty costumes 2018-04-20 10:45:54 -04:00
Paul Kaplan
54d5be8bba Do not bother repositioning bubbles for invisible sprites 2018-04-20 10:45:34 -04:00
Paul Kaplan
9782c137bb Use the new general target visual change for updating bubbles. 2018-04-20 10:44:55 -04:00
kchadha
8739a524eb
Merge pull request #1031 from kchadha/block_serialization_compression
Block serialization compression
2018-04-11 19:17:42 -04:00
Paul Kaplan
f29482957c Change getSkinSize to getCurrentSkinSize for renderer update. 2018-04-10 09:50:18 -04:00
kchadha
d177f4cd0c
Merge pull request #1033 from towerofnix/counter-vm
Implement counter blocks
2018-04-09 13:55:35 -04:00
Florrie
797d16be26 Implement counter blocks 2018-04-07 16:02:49 -03:00
Florrie
c57d0c94eb Add implementation for while 2018-04-07 14:04:00 -03:00
Karishma Chadha
44b1a2f798 List limit should apply to insert block as well. 2018-04-06 15:31:10 -04:00
Karishma Chadha
b436b5fd82 Add a limit to the number of items a list can have. No-op on 'addToList' block if trying to add to a list that is already at the limit. 2018-04-06 11:33:44 -04:00
Florrie
b861c78086 Implement 'get item # of (thing) in (list)' 2018-03-31 13:25:50 -03: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