Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » I need help.
- teamsonic2011
- Scratcher
1000+ posts
I need help.
I'm developing my extension Yoshi, but I need the code that will import an image as a costume.
Also, please add it to the source code below:
(function(Scratch) {
‘use strict’;
if (!Scratch.extensions.unsandboxed) {
throw new Error('This extension must run unsandboxed');
}
class YoshiBlocks {
getInfo() {
return {
id: ‘yoshi’,
name: ‘Yoshi’,
// colors
color1: ‘#55aa00’,
color2: ‘#55aa00’,
color3: ‘#000000’, // Yoshi Green
blocks: [
{
opcode: ‘yoshi’,
blockType: Scratch.BlockType.REPORTER,
text: ‘Yoshi!’
},
{
opcode: ‘spawnegg’,
blockType: Scratch.BlockType.COMMAND,
text: ‘spawn Yoshi Egg’,
}
]
};
}
yoshi() {
return ‘Yoshi!!’;
spawnegg()
// CODE HERE
}
Scratch.extensions.register(new YoshiBlocks());
})(Scratch);
Also, please add it to the source code below:
(function(Scratch) {
‘use strict’;
if (!Scratch.extensions.unsandboxed) {
throw new Error('This extension must run unsandboxed');
}
class YoshiBlocks {
getInfo() {
return {
id: ‘yoshi’,
name: ‘Yoshi’,
// colors
color1: ‘#55aa00’,
color2: ‘#55aa00’,
color3: ‘#000000’, // Yoshi Green
blocks: [
{
opcode: ‘yoshi’,
blockType: Scratch.BlockType.REPORTER,
text: ‘Yoshi!’
},
{
opcode: ‘spawnegg’,
blockType: Scratch.BlockType.COMMAND,
text: ‘spawn Yoshi Egg’,
}
]
};
}
yoshi() {
return ‘Yoshi!!’;
spawnegg()
// CODE HERE
}
Scratch.extensions.register(new YoshiBlocks());
})(Scratch);
Like PaRappa, you gotta believe!
Give me an internet
Dis is a Yoshi
Friend me on 3DS Name: Hank FC: 3196-9968-9861
Windows XP Fat Yoshi edition
Yoshi's Adventure
- Discussion Forums
- » Developing Scratch Extensions
- » I need help.