Skip to content

Commit 317186a

Browse files
author
BlueDome
authored
true-fantom/couplers: add more couplers (#757)
Added COLOR, ANGLE, MATRIX, and NOTE reporters from LMS Utils.
1 parent cd8e456 commit 317186a

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

extensions/true-fantom/couplers.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,53 @@
8585
blockType: Scratch.BlockType.BOOLEAN,
8686
text: 'false',
8787
hideFromPalette: true
88+
},
89+
90+
'---',
91+
92+
{
93+
opcode: 'color_block',
94+
blockType: Scratch.BlockType.REPORTER,
95+
text: 'color [COLOUR]',
96+
arguments: {
97+
COLOUR: {
98+
type: Scratch.ArgumentType.COLOR,
99+
defaultValue: '#ff0000'
100+
}
101+
}
102+
},
103+
{
104+
opcode: 'angle_block',
105+
blockType: Scratch.BlockType.REPORTER,
106+
text: 'angle [ANGLE]',
107+
arguments: {
108+
ANGLE: {
109+
type: Scratch.ArgumentType.ANGLE,
110+
defaultValue: '90'
111+
}
112+
}
113+
},
114+
{
115+
opcode: 'matrix_block',
116+
blockType: Scratch.BlockType.REPORTER,
117+
text: 'matrix [MATRIX]',
118+
arguments: {
119+
MATRIX: {
120+
type: Scratch.ArgumentType.MATRIX,
121+
defaultValue: '0101001010000001000101110'
122+
}
123+
}
124+
},
125+
{
126+
opcode: 'note_block',
127+
blockType: Scratch.BlockType.REPORTER,
128+
text: 'note [NOTE]',
129+
arguments: {
130+
NOTE: {
131+
type: Scratch.ArgumentType.NOTE,
132+
defaultValue: ''
133+
}
134+
}
88135
}
89136
],
90137
menus: {
@@ -119,6 +166,18 @@
119166
false_block() {
120167
return false;
121168
}
169+
color_block(args) {
170+
return args.COLOUR;
171+
}
172+
angle_block(args) {
173+
return args.ANGLE;
174+
}
175+
matrix_block(args) {
176+
return args.MATRIX;
177+
}
178+
note_block(args) {
179+
return args.NOTE;
180+
}
122181
}
123182

124183
Scratch.extensions.register(new Couplers());

0 commit comments

Comments
 (0)