Commit Graph
81 Commits
Author SHA1 Message Date
Paul Kaplan 4a7ba534c1 Fix linter 2017-09-11 15:15:30 -04:00
Paul Kaplan 81370f7625 Refactor method exports to fix linting and CWF comment 2017-09-11 10:11:48 -04:00
Paul Kaplan b68b874067 Add sprite duplication method 2017-09-07 11:51:21 -04:00
Paul Kaplan 44298fd71b Use soundId instead of md5 for playing sounds 2017-07-25 12:20:32 -04:00
Christopher Willis-Ford 88e44c65eb Remember the data format when an asset is imported 2017-06-12 12:31:49 -07:00
Christopher Willis-Ford eb931fd99b Specify dataFormat when loading asset for import
When importing a project we know the file extension for each asset to be
loaded. This change provides that information to the storage system so
that we can load assets which don't use the default. For example, this
allows loading JPG-format backdrops.

In support of this change, there's a new function on `StringUtil` called
`splitFirst`, which splits a string on the first instance of a separator
character. This change includes unit tests for this new function.
2017-05-24 15:35:10 -07:00
Ray Schamp 2181e51c38 Don't store costume data uris on costumes 2017-05-04 12:29:28 -04:00
Ray Schamp c5cf6d9b40 Use asset id reference on sounds 2017-05-04 12:29:10 -04:00
Ray Schamp c9ce6776aa Get SB3 imports working
For now, store the md5 + extension on costumes in the VM. This way we can load them the same way as we load SB2 assets.
2017-04-27 17:08:06 -04:00
Ray Schamp a4cdb027ab Merge branch 'develop' of github.com:morantsur/scratch-vm into feature/serialization
# Conflicts:
#	src/playground/index.html
#	src/serialization/sb2.js
#	src/sprites/rendered-target.js
#	src/virtual-machine.js
#	test/unit/serialization_sb2.js
2017-04-26 11:44:53 -04:00
Christopher Willis-Ford c750f53c81 Get Asset and AssetType from storage instance 2017-04-20 16:12:17 -07:00
Ray Schamp 9c34b692c0 Fix ES6 lint after merge 2017-04-19 17:54:52 -04:00
Ray Schamp e96807b399 Merge branch 'develop' of https://github.com/LLK/scratch-vm into es6
# Conflicts:
#	src/import/sb2import.js
#	src/virtual-machine.js
#	webpack.config.js
2017-04-19 17:54:31 -04:00
Ray Schamp d2343e3601 Fix up some auto-converted weirdness 2017-04-19 17:36:33 -04:00
Paul Kaplan 4b5e7a57a5 Fix binding issues 2017-04-19 08:53:07 -04:00
Paul Kaplan f161640876 Update tests 2017-04-18 11:55:38 -04:00
Paul Kaplan d86fe6a075 Do not add targets to runtime until they are fully loaded 2017-04-18 09:27:58 -04:00
Ray Schamp 4455b0694f Fix remaining no-var and no-use-before-define's 2017-04-17 17:15:19 -04:00
Ray Schamp e01c4ae108 Pass with --fix 2017-04-17 15:10:04 -04:00
Paul Kaplan 771f18e23b Merge pull request #516 from paulkaplan/add-sound-public-api
Expose VM#addSound publicly
2017-04-04 09:05:45 -04:00
Paul Kaplan 2d6eaae01e Update jsdoc 2017-04-03 16:00:58 -04:00
Paul Kaplan 33f436811c return sound in promise 2017-04-03 16:00:31 -04:00
Ray Schamp 57e73a68a6 Add costume dataURI to costumes from storage (#517)
* Add costume dataURI to costumes from storage

Towards #515, LLK/scratch-gui#279

* Fix tests

* Load costumes incrementally

Some of our tests assume that at least some of our costume data is available before the costume data is loaded. So, provide as much costume data as is available.

* Remove unnecessary filter for null costumes

Resolved when we updated to load costumes incrementally.

/ht @cwillisf
2017-04-03 15:58:13 -04:00
Paul Kaplan 251244ce9c Expose VM#addSound publicly 2017-04-03 09:33:23 -04:00
Paul Kaplan 828f7bfd1c Merge pull request #514 from paulkaplan/fix-costume-backdrop-loading
Use costume loading from importer in public costume and backdrop loader
2017-03-31 12:52:06 -04:00
Paul Kaplan 2559f9557f Resolve to null on error 2017-03-31 11:26:20 -04:00
Eric Rosenbaum 5d14315199 Use log.error 2017-03-29 12:28:20 -04:00
Paul Kaplan 6531dbc2fe Add logger (thanks linter) 2017-03-27 15:12:25 -04:00
Paul Kaplan df44134e1c Use costume loading from importer in public costume and backdrop loader 2017-03-27 15:04:44 -04:00
Eric Rosenbaum 1ec1165905 Audio engine decodes sounds 2017-03-27 11:56:28 -04:00
Christopher Willis-Ford 10cb97c52e Report missing storage module as an error 2017-03-23 16:03:32 -07:00
Christopher Willis-Ford c945b37288 Fix lint, missing require 2017-03-13 15:44:13 -07:00
Christopher Willis-Ford 6ad0f3351b Check if storage module is present before using it 2017-03-13 15:06:28 -07:00
Christopher Willis-Ford e4fd9d57a2 Fix tests involving scratch-storage
- Attach the storage module to the VM for tests which load projects or
  other assets.
- Move `import_sb2.js` from `test/unit/ into `test/integration` since it
  now depends heavily on `scratch-storage`.
- Skip loading costumes when there is no renderer.
2017-03-09 15:50:43 -08:00
Christopher Willis-Ford c23e9c6bf8 Load projects & costumes through scratch-storage
This also sets up the framework to load sounds through scratch-storage,
to be finished in a later change.
2017-03-09 11:25:55 -08:00
Ray Schamp 8dadc42857 Add draggable property to sprites
This property should be managed by the VM so that it can be displayed in the sprite info panel in the GUI.
2017-03-01 18:49:17 -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
Andrew Sliwinski 7c18b33f99 Continue import if opcode is not found during SB2 import. Resolves GH-413 2017-01-30 14:32: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 d5e0d433aa include md5 in sprite sound object 2017-01-30 10:43:28 -05:00
griffpatch 2ac4b73a1f Importers: adjust block coordinate calculation so blocks overlap less. #326
This change imports the scratch blocks much closer to the Scratch 2
spacing.
2017-01-27 13:39:21 +00: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 3344c92f7e change ‘drumtype’ to ‘drum’ in specmap 2017-01-10 18:00:02 -05:00
Eric Rosenbaum fec9e5b91a add audio to playground 2017-01-06 11:49:25 -05:00
Andrew Sliwinski 6d83931341 WIP clean-up 2016-12-30 10:19:58 -05:00
Eric Rosenbaum f0e01d3e87 fix name of sounds menu 2016-12-22 14:12:20 -05:00
Eric Rosenbaum f2793a1d59 Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
# Conflicts:
#	package.json
#	src/engine/runtime.js
#	src/sprites/clone.js
2016-12-21 15:29:57 -05:00
Tim Mickel 2f0ce7137c Rename Clone -> RenderedTarget (#317) 2016-10-26 11:19:43 -04:00