-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support most Scratch blocks #18
Comments
Looks like you’ve done a lot recently! Loads of compatibility. :D Looks like I can keep writing documentation! |
@micahlt That would be fantastic! :) |
Many blocks are straightforward to implement, but a few pose questions:
|
Yes. Especially because
Import the sprite class! Magic strings are
(You could also provide a import Cat from './cat.mjs'
createCloneOf("Cat".toSprite())
createCloneOf(Cat) but ehhhh) |
@nanaian Agree on speech bubbles. You're right that magic strings are a bad plan. Thanks for making it clear. One thing that's kind of weird about passing the class directly is that it feels like we should be passing the instance instead. If I run The tricky part is allowing one sprite to get its hands on an instance of another. Currently, all sprites are instantiated once and then passed to the |
So something more like const meowth = new Cat() // ie. not automagically instanciated by Project
meowth.myVariable // 'original'
meowth.myVariable = 'somethingElse'
const persian = clone(meowth) // inherits variables of meowth
meowth.myVariable // 'somethingElse'
const skitty = new Cat()
skitty.myVariable // 'original' is on the table? If we did the scope thing currently being discussed in #19, we would likely encourage doing |
Yeah, that's totally an option. It definitely feels like there could be a nice two-in-one solution to both the scope problem and the accessing instances problem. I just don't know what it is. :P Edit: To nitpick, we would probably do const persian = meowth.clone() but it's the same idea. |
I've been testing the compiler with a bunch of projects pulled from the Scratch "explore" page (and some from the home page). It seems like the most commonly used features which are still missing are, in roughly decending order, the following:
|
Using the Tone.js library would make adding drums, sound effects, and general audio a lot easier but I think it would mess with the whole concept of not having to build/install anything :/ |
Sound blocks can all be marked complete now! |
Oh nice! I was just procrastinating on figuring out how the site repo works and making a PR for that, lol. (Yess!!) |
|
(wow this issue is inactive for a pretty long time I guess) |
|
Cloud variables could be supported with this (extremely simple) Javascript library that seems to be very Scratch-inspired: Looking through the author's other projects, it appears that he's a lifelong Scratcher. :) The code for the client is quite minimalistic, and the server code isn't much larger. We could either link to this project or copy / adapt it more wholesale -- there is no license attached to the code, so we may want to inquire about it. |
Built-in
✔ Motion
Looks
✔ Sound
✔ Events
Control
Sensing
this.timer
Username(N/A)✔ Operators
✔ Variables
Variables
Lists
✔ My Blocks
Custom blocks are a feature. There aren't any predefined blocks to support, because... well. You know.
Extensions
Music
✔ Pen
Other Extensions...
Supporting hardware/api scratch extensions natively is out of the scope of Leopard.
The text was updated successfully, but these errors were encountered: