Add spacebar input; add shape enabling/disablg and sensors

This commit is contained in:
2023-01-16 23:18:09 +00:00
parent 4ee6e1683b
commit 5085597eeb
6 changed files with 23 additions and 166 deletions

View File

@@ -152,6 +152,17 @@ duk_ret_t duk_cmd(duk_context *duk) {
set_trigger_color(duk2color(duk, 1));
break;
case 18:
cpShapeSetSensor(id2shape(duk_to_int(duk, 1)), duk_to_boolean(duk, 2));
break;
case 19:
if (id2shape(duk_to_int(duk, 1)))
duk_push_boolean(duk, cpShapeGetSensor(id2shape(duk_to_int(duk, 1))));
else
duk_push_undefined(duk);
return 1;
}
return 0;