-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Makey Makey extension #1782
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
Makey Makey extension #1782
Conversation
benjiwheeler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting, I love this.
rschamp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! I have a question you probably already considered.
| // Set an interval that toggles the frameToggle every frame. | ||
| setInterval(() => { | ||
| this.frameToggle = !this.frameToggle; | ||
| }, this.runtime.currentStepTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a step event...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would be handy!
| * @param {string} sequenceString a string of space-separated KEY_IDs. | ||
| * @param {array} sequenceArray an array of KEY_IDs. | ||
| */ | ||
| addSequence (sequenceString, sequenceArray) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't it matter that there is addSequence but not removeSequence? What happens after you don't listen for a sequence anymore? What if someone put a variable into the hat block and then changed that variable in a forever loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it (only a little bit, really) and decided that it would be a rare and weird situation that is (I think) no more harmful than other things that you can do, likely only on purpose, to mess up Scratch, such as storing tons of data in variables and lists. Then again, we should find a way to fix it! I'll make a follow-up issue to consider different options.
Hey cool, an extension for the Makey Makey!
Wait... what?
Uh, hm. Good point. Technically, Makey Makey already just works with Scratch 3.0. You can use the existing "when key pressed" block.
So, like, why?
Woah what's the new block?
It's "when [left up right] pressed in order". It lets you detect that a sequence of keyboard keys was pressed. The menu contains several other sequences. These can be used, for example, to add secret codes to games and other projects (unlock the secret level!).
Some people have also experimented with a kind of "gesture" sensing using makey makey: put two or more inputs (such as graphite shapes or foil patches) in a row, and swipe your finger across them to make something happen. This is an advanced makey makey technique, but it's cool, and this block makes it much easier to try.
You can also drop a variable onto it with space-separated key names, to create your own sequence (such as "up down left right" or "a b c d").