Commit graph

386 commits

Author SHA1 Message Date
Tim Mickel
0ede7e6ca1 Rename and delete sprites (#319)
* Add function to rename sprites

* Add delete sprite function

* Add `isSprite` helper and duplicate check for rename
2016-10-26 13:27:24 -04:00
Tim Mickel
56ef01745f Implement sprite info emitting and posting (#320) 2016-10-26 13:27:12 -04:00
Tim Mickel
1dc4aaa2d7 Remove rAF usage and inline into _step (#318) 2016-10-26 11:32:15 -04:00
Tim Mickel
2f0ce7137c Rename Clone -> RenderedTarget (#317) 2016-10-26 11:19:43 -04:00
Tim Mickel
6e9b3f262c Divide rotation center by bitmap resolution (#309) 2016-10-26 10:38:24 -04:00
Tim Mickel
d75f1c5965
Remove empty project 2016-10-26 10:30:16 -04:00
Tim Mickel
cf20ca1add Fix #313 (block specs in shadow) (#315) 2016-10-26 10:26:56 -04:00
Tim Mickel
28a0831e8d Fix 1-1 in daysSince2000 2016-10-26 10:26:03 -04:00
Tim Mickel
5103cfb853 Address #299 and #300 (#314)
* Place clones behind sprite

* Disallow stage from cloning itself
2016-10-26 10:06:58 -04:00
Liam
f75577bcbe Implement '(attribute) of' sensing block (#311)
* Implement '(attribute) of' sensing block

* Remove unused util parameter
2016-10-24 20:37:27 -04:00
Eric Rosenbaum
90867cd14e convert string to number for sound index 2016-10-24 17:00:51 -04:00
Andrew Sliwinski
1b4a1ca1bc Resolve merge conflicts 2016-10-24 15:53:42 -04:00
Andrew Sliwinski
153df22918 Address feedback from PR review 2016-10-24 15:16:06 -04:00
Ray Schamp
659014b45f Fix typo 2016-10-24 14:07:38 -04:00
Ray Schamp
d2a0e6fa2d Disable no-useless-call in case of behavior change 2016-10-24 13:01:57 -04:00
Ray Schamp
22bf947ddb Revert no-lonely-if 2016-10-24 13:01:41 -04:00
Andrew Sliwinski
279a9560af Resolve JSDoc lint errors 2016-10-24 12:04:06 -04:00
Andrew Sliwinski
336bc65e2d Add minimal test coverage and docs for mouse module 2016-10-24 11:56:52 -04:00
Ray Schamp
04d7f4f019 Use consistent function declaration style 2016-10-24 11:49:34 -04:00
Andrew Sliwinski
2de58050dd Conform JSdoc for keyboard module to format used elsewhere 2016-10-24 11:40:07 -04:00
Ray Schamp
9f0c4eb098 Update to eslint-config-scratch 2.0
We are on a fast release cycle here.
2016-10-24 11:39:39 -04:00
Ray Schamp
63cfa4229a Fix space-infix-ops
http://eslint.org/docs/rules/space-infix-ops
2016-10-24 11:19:07 -04:00
Ray Schamp
7712b2902f Fix quote-props 2016-10-24 11:02:19 -04:00
Ray Schamp
14a2dbc50f Revert no-lonely-if 2016-10-24 10:28:31 -04:00
Ray Schamp
73edb65c4d Replace console with minilog 2016-10-23 22:20:30 -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
Andrew Sliwinski
faf8a898a0 Add minimal test coverage and docs for keyboard module. 2016-10-21 18:31:07 -04:00
Tim Mickel
84bd42d734 Functions to add Sprite2/costumes/backdrops (#291)
* Functions to add Sprite2/costumes/backdrops

* Have sb2import return the top-level target
2016-10-20 11:44:01 -04:00
Tim Mickel
3d57c2e74c Drop single-stepping and pause modes (#294) 2016-10-20 11:42:16 -04:00
Tim Mickel
9af9a87cb6 Pass rotation center and bitmap resolution to renderer (#288) 2016-10-19 17:01:48 -04:00
Eric Rosenbaum
0858a22ffb adding theremin block and set instrument 2016-10-19 15:44:30 -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
060d1ab2a5 Updated blocks for new renderer features (#257)
* Add "touching" block, layers blocks

* Keep in fence, if on edge bounce, fix to touching edge

* Fix degtoRad in "if on edge, bounce"

* Fixes from review
2016-10-17 23:17:55 -04:00
Eric Rosenbaum
6d9f889aa7 fixed sound loading 2016-10-17 17:16:55 -04:00
Eric Rosenbaum
ba84b6e34b move audioengine to its own module 2016-10-17 17:16:13 -04:00
Eric Rosenbaum
7bd0142deb Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
# Conflicts:
#	playground/index.html
2016-10-17 17:13:43 -04:00
Tim Mickel
352c6516d3 Fix parent setting in sb2 importer (#283) 2016-10-17 16:44:33 -04:00
Cosmic Web Services
454eb904a3 Add days since 2000 block (#272)
* Add days since 2000 block

* Empty line addition

* Add semicolin

* Empty line addition

* Tabed

* Remove extra line

* Make it exactly like scratch 2 was

* Fixed spacing
2016-10-17 13:57:25 -04:00
Ray Schamp
2904152318 Merge pull request #282 from rschamp/feature/vm.clear
Add VM.clear method
2016-10-17 13:56:37 -04:00
Ray Schamp
5615583fb2 Lint 2016-10-17 13:54:27 -04:00
Ray Schamp
bd95c1461d Add VM.clear method
Use it before loading projects so targets don't accumulate when multiple projects are loaded on the same instance.

Move check to see if the clone is the original clone onto the block implementation so all clones can be removed.

Fixes #274
2016-10-17 13:43:38 -04:00
Andrew Sliwinski
ace9a96fc2 Fix degToRad function definition. Resolves GH-229 2016-10-17 11:52:02 -04:00
Tim Mickel
3bfd755e60 Complete implementation of stop block (#271)
* "Other scripts in stage" sb2

* Complete implementation of "stop" block
2016-10-13 23:00:46 -04:00
Tim Mickel
c45b420115 Fix check for existing hat threads (#269) 2016-10-13 22:14:19 -04:00
Tim Mickel
1e86d48a31 Clicking blocks in the toolbox (#267) 2016-10-13 17:15:49 -04:00
Tim Mickel
8c654bbe60 Procedure blocks (#264) 2016-10-13 13:11:26 -04:00
Eric Rosenbaum
31d680a229 lint 2016-10-13 11:54:00 -04:00
Eric Rosenbaum
d808a83f79 lint 2016-10-13 11:48:31 -04:00
Eric Rosenbaum
e084a76485 lint 2016-10-13 11:35:52 -04:00
dekrain
91037a261e Fix relative localization for assets 2016-10-13 16:19:42 +02:00
Eric Rosenbaum
80764f053d lint 2016-10-12 17:22:50 -04:00
dekrain
49d6bd3b67 Fix new project creation (#256)
* Fix new project creation

* Fix new project creation

* const -> var
2016-10-12 13:56:31 -04:00
Eric Rosenbaum
7b179546ed new setup for use with scratch-gui 2016-10-12 13:17:51 -04:00
Tim Mickel
a7522c7734 Fix data_listcontents block name (#254) 2016-10-11 17:12:19 -04:00
Eric Rosenbaum
0024b209bd Merge remote-tracking branch 'LLK/develop' into develop 2016-10-11 13:47:24 -04:00
Eric Rosenbaum
ed650ba487 Merge remote-tracking branch 'LLK/develop' into develop 2016-10-05 17:16:13 -04:00
Liam
30535d8e6e Implement "distance to" block (#239)
* Implement "distance-to" block

* distance-to in stage should always be 10000
2016-10-04 21:26:59 -04:00
TheBrokenRail
9b07889b3f Fix Stage PNG (#241)
* Fix Stage PNG

* Add New Stage PNG

* Remove Old Stage PNG

* Delete backdrop1.png

* Rename New Stage PNG

* Delete stage.png

* Fix Stage Resolution
2016-10-04 20:38:11 -04:00
Liam
5871672551 Implement "go to" block (#238)
* Implement "go to" block

* Add a missing semicolon

My text editor doesn't automatically insert them and I'm not used to using
semicolons so much. :(

* Implement go-to-random

* Clean up the go-to-random code a bit

* Add rounding to _random_ picks
2016-10-04 18:19:52 -04:00
Liam
886bcbe3c1 Implement the point-towards block (#235)
* Implement the point-towards block

* Pointing towards a nonexistent sprite should do nothing, not throw an error
2016-10-04 15:20:53 -04:00
Eric Rosenbaum
0db0783fe8 working on sound font player 2016-10-04 14:19:04 -04:00
Tim Mickel
0a66c62f6a Mutations in block representation; an unfeatured procedure call (#212)
* Add scratch3_procedures and no-op for defnoreturn

* Add mutation adapter to parse mutations in CREATE/CHANGE events

* Add mutation-to-XML

* Update spec map for Blockly procedure names

* Placeholder for procedure special cases

* Basic stepping to procedures

* Remove extra case

* Validation for changeBlock
2016-10-03 17:43:24 -04:00
Tim Mickel
5728d648b1 Ensure clone.effects is defined on each instance (#225)
* Ensure clone.effects is defined on each instance

* Add regression test for GH-224
2016-10-03 10:16:43 -04:00
Eric Rosenbaum
e1df4b3aaf fixed dictionary of loaded sounds 2016-10-01 17:27:28 -04:00
Tim Mickel
2226fda19e Implement rotation style (#223) 2016-09-28 17:09:04 -04:00
Tim Mickel
d10ba11c8f Round costume values (#221) 2016-09-28 16:43:12 -04:00
Tim Mickel
a585a08a93 Remove extra calls to updateAllDrawableProperties (#222) 2016-09-28 16:43:04 -04:00
Eric Rosenbaum
6988cfc0d3 starting to load sounds from project files 2016-09-28 16:42:25 -04:00
Eric Rosenbaum
7c91565408 Merge branch 'develop' of https://github.com/LLK/scratch-vm into develop 2016-09-27 18:12:20 -04:00
Eric Rosenbaum
39c8e76bdf adding sound blocks 2016-09-27 17:09:53 -04:00
Tim Mickel
2357d63243 Drop useRound option from Cast.toListIndex (#213)
* Drop `useRound` option from `Cast.toListIndex`

* Param fix
2016-09-26 12:01:21 -04:00
Tim Mickel
2d736f2b87 "Wait until" implementation (#210) 2016-09-22 17:00:38 -04:00
Tim Mickel
a118d50056 Variables and lists (#187)
* Import lists and variables from SB2

* Switch to Variable and List objects

* Add Clone.lookupOrCreateVariable, Clone.getVariable, Clone.setVariable

* Add (get, set, change) variable blocks.

* Copy variables and lists on clone instantiation

* Move variable options closer to blocks

* Add list primitives

* Move variable and lists storage to `Target` instead of `Clone`

* Move _computeIndex to a Cast function

* Rename `getList` -> `getListAsString`

* Renames renames

* Remove extra check in Cast.isNaN
2016-09-21 16:38:33 -04:00
Tim Mickel
a687184c3c Fix and improve playground threads display (#198) 2016-09-21 16:31:23 -04:00
Tim Mickel
aa5e8d2648 Clear graphic effects on green flag (#199) 2016-09-21 16:31:07 -04:00
Ray Schamp
4e547556a8 Use attachRenderer rather than the constructor
This makes the renderer optional as well as making the order of instantiation flexible.
2016-09-20 15:09:21 -04:00
Ray Schamp
fa10a2279a Only expose VirtualMachine to window for bundles 2016-09-20 10:29:47 -04:00
Ray Schamp
499ba5235c Scope renderer to instance
This allows usage without global scope to attach a renderer to the VM. It also provides the ability to have multiple VMs/renderers to be used at once.
2016-09-20 02:52:33 -04:00
Tim Mickel
c02ee88d02 Add some more info/links to sb2specmap (#197) 2016-09-19 15:24:46 -04:00
Tim Mickel
13f287e871 Fix up property imports from SB2 (#196)
* Update target's drawable properties after SB2 import

* Always use `hasOwnProperty` parsing SB2 JSON
2016-09-19 14:40:01 -04:00
Tim Mickel
9744bcbb70 Clones (#150)
* Provide property to Clone to distinguish "original" clones

* Provide method to clone a clone's properties

* Don't report clones in the UI target list

* Add target info to Thread

* Allow hats to skip clones (for green flag)

* Green flag skips clones

* Implement "create clone" and hat

* Pass the runtime to sprites and clones (for start hats)

* Clone disposal; trigger hats after drawable initializes.

* Separate stop threads for target; fix handling of stop button

* Remove extraneous `skipClones` property

* Add global clone limit

* Don't allow a non-clone to delete itself.

* Rename `cloneClone` -> `makeClone`

* Variable updates in runtime.js

* Synchronous drawable initialization (until we put it back to promises)
2016-09-15 19:37:12 -04:00
Tim Mickel
542899949e Update for RenderWebGLLocal -> RenderWebGL (#181)
* Update for RenderWebGLLocal -> RenderWebGL

* Move button under title
2016-09-15 19:02:03 -04:00
Tim Mickel
6b3f0d3d8a Playground update; update SB2 spec map for list, _ of _ blocks (#184)
* Playground update

* Update SB2 spec map for list, _ of _ blocks
2016-09-15 17:10:32 -04:00
Eric Rosenbaum
8872f663a4 Merge remote-tracking branch 'LLK/develop' into develop
# Conflicts:
#	playground/index.html
#	playground/playground.js
#	src/engine/execute.js
#	src/engine/runtime.js
#	src/index.js
#	src/sprites/clone.js
2016-09-15 16:58:41 -04:00
Eric Rosenbaum
47c0f18e85 adding more sound blocks 2016-09-15 16:51:24 -04:00
Eric Rosenbaum
aa812aa6b7 worker less audio engine, can meow 2016-09-15 15:59:29 -04:00
Tim Mickel
8987330853 Cleanly handle deleting running scripts (#162)
* Cleanly handle deleting running scripts

* Turn off glow request on retire thread; add null check
2016-09-15 13:51:40 -04:00
Tim Mickel
1ebee14eb0 Update sb2specmap.js for droppable broadcast (#182) 2016-09-14 16:43:21 -04:00
Eric Rosenbaum
e19c1942c3 Merge remote-tracking branch 'LLK/develop' into develop
# Conflicts:
#	src/index.js
#	src/sprites/clone.js
#	src/worker.js
2016-09-13 18:09:43 -04:00
Tim Mickel
dec5d054c8 Better handling of float values (fix #172) (#176)
* Better handling of float values (fix #172)

* Stricter equality in Cast.isInt
2016-09-13 17:53:17 -04:00
Eric Rosenbaum
d9a703b4ad play sound and play note block 2016-09-13 17:52:54 -04:00
Tim Mickel
6b08b95b97 Escape field values for XML-unsafe characters (#177)
* Escape field values for XML-unsafe characters

* String equality check ===
2016-09-13 17:51:17 -04:00
Tim Mickel
08b40b4d1d Drop worker support (#175)
* Take out worker code

* Fix Blockly event listening (minus worker)

* Recompile Sept. 13
2016-09-13 17:49:45 -04:00
Tim Mickel
833c5ed313 When clicked hats (#156) 2016-09-12 17:16:10 -04:00
Tim Mickel
c357a62005 Key repeats, with OS delay (#168) 2016-09-12 13:52:44 -04:00
Tim Mickel
91cdec1547 Implement glide (#154) 2016-09-12 13:26:10 -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
ebbfe881db Augment Timer with documentation and self.performance.now (#163)
* Augment Timer with documentation and `self.performance.now`

* Add undefined check for `self`.
2016-09-12 13:09:01 -04:00
Tim Mickel
79346c0925 Fixes for #138 (#166)
* Markup/CSS adjustments

* Move assets to folder

* Strip extra font-family

* More robust handling of project-load fail state

* Move empty project creation to its own function

* Move green flag/stop back out of the tab

* Restore default id
2016-09-12 12:03:24 -04:00