diff --git a/src/lib/libraries/extensions/index.jsx b/src/lib/libraries/extensions/index.jsx index 955a5188f4d..861cfa83436 100644 --- a/src/lib/libraries/extensions/index.jsx +++ b/src/lib/libraries/extensions/index.jsx @@ -1579,6 +1579,15 @@ if (IsLocal || IsLiveTests) { description: 'i was bored ok', featured: true, }, + { + name: 'p5.js', + extensionId: 'https://editor.snail-ide.com/p5js.png', + collaborator: 'Mr_rudy/nmsderp', + iconURL: defaultExtensionIcon, + tags: ['penguinmod'], + description: 'A more powerful alternative to the Pen extension.', + featured: true, + }, { name: 'Handpose2scratch', extensionId: 'handpose2scratch', diff --git a/static/p5.js b/static/p5.js new file mode 100644 index 00000000000..fd470718c5d --- /dev/null +++ b/static/p5.js @@ -0,0 +1,40 @@ +var script = document.createElement('script'); +script.src = 'https://cdn.jsdelivr.net/npm/p5@1.9.2/lib/p5.js'; + +class p5Extension { + constructor() { + this.x = 0; + this.y = 0; + } + + getInfo() { + return { + id: 'p5js', + name: 'p5.js', + blocks: [ + { + opcode: 'drawcirclesimple', + blockType: Scratch.BlockType.COMMAND, + text: 'draw circle at x: [X] and y: [Y]', + arguments: { + X: { + type: Scratch.ArgumentType.STRING, + defaultValue: '0' + }, + Y: { + type: Scratch.ArgumentType.STRING, + defaultValue: '0' + } + } + } + ] + }; + } + + drawcirclesimple(args) { + console.log('lol not done'); + } +} + +Scratch.extensions.register(new p5Extension()); +document.head.appendChild(script); diff --git a/static/p5js.png b/static/p5js.png new file mode 100644 index 00000000000..3f0bb107049 Binary files /dev/null and b/static/p5js.png differ