52 lines
988 B
JavaScript
52 lines
988 B
JavaScript
export function behaviorTypes() {
|
|
return {
|
|
vector: {
|
|
defaultLiteral: [0, 0],
|
|
children: {
|
|
x: {
|
|
type: 'number',
|
|
label: 'X',
|
|
},
|
|
y: {
|
|
type: 'number',
|
|
label: 'Y',
|
|
},
|
|
},
|
|
},
|
|
Vector: (Math) => ({
|
|
children: {
|
|
floor: {
|
|
type: 'vector',
|
|
label: 'Floor $1.',
|
|
args: [
|
|
['vector', {
|
|
type: 'vector',
|
|
}],
|
|
],
|
|
},
|
|
fromDirection: {
|
|
type: 'vector',
|
|
label: '$1 as a movement vector.',
|
|
args: [
|
|
['direction', {
|
|
type: 'number',
|
|
}],
|
|
],
|
|
},
|
|
sub: {
|
|
type: 'vector',
|
|
label: 'Subtract $2 from $1.',
|
|
args: [
|
|
['l', {
|
|
type: 'vector',
|
|
}],
|
|
['r', {
|
|
type: 'vector',
|
|
}],
|
|
],
|
|
},
|
|
},
|
|
}),
|
|
};
|
|
}
|